Issue Details (XML | Word | Printable)

Key: XW-559
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Rainer Hermanns
Reporter: Aadi Deshpande
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XWork

no error reported when accessing a non-existent property in the compoundroot

Created: 05/Sep/07 04:18 PM   Updated: 15/Oct/07 12:06 PM
Component/s: None
Affects Version/s: 2.1
Fix Version/s: 2.1

File Attachments: 1. Text File compound-root-logging-patch.txt (1 kB)
2. Text File mvn.log (282 kB)
3. Zip Archive struts2-example.zip (1.06 MB)

Issue Links:
Duplicate
 

Flags: Patch


 Description  « Hide
prompted from this posting :

http://raibledesigns.com/rd/entry/does_struts_2_suck

it's possible for ognl to report that a property does not exist, just that no logging was coded up.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Matt Raible added a comment - 05/Sep/07 04:54 PM
This patch provides too much information to be useful. Attached is my log file when I have the following in log4j.xml:

"theme", "templateDir" and others are variables that I don't have specified in my page or SiteMesh decorator. Also, I don't think there should be an error thrown when the source value is null, as that's to be expected when you're adding a new record (for example). This patch does not log "source is null" messages IMO.

Also, there's no mention that one of my method calls failed:

<s:property value="methodDoesntExist('foo')"/>

Thanks,

Matt

Matt Raible added a comment - 07/Sep/07 01:23 PM
Attached is a sample app to reproduce this behavior. From its README.txt:

This application was created to show how Struts2/XWork doesn't throw
exceptions or log errors when a property doesn't exist. Furthermore,
it doesn't notify the user when a method doesn't exist.

http://raibledesigns.com/rd/entry/does_struts_2_suck
http://jira.opensymphony.com/browse/XW-559

The User Details page in this application has an invalid field that
doesn't throw an error. It uses "user.favoriteMovie" as a property
and there's no report of an error. It also calls an invalid method in
an <s:property> tag and nothing happens.

To run, download Maven 2.0.7, install and run "mvn jetty:run" from
the root directory of this application. Then go to:

http://localhost:8080/editUser.html

You can create IDEA project files using "mvn idea:idea".

** To change this project to use XWork 2.1-SNAPSHOT, simply modify
   pom.xml to uncomment the XWork-related dependencies.

Matt Raible added a comment - 20/Sep/07 10:56 AM
Any suggestions on the best way to fix this?

Thanks,

Matt

Matt Raible added a comment - 24/Sep/07 11:10 AM
I just did an "svn up" and it appears that CompoundRootAccessor is no longer in Subversion. Is there a changelog (FishEye) I can read somewhere?

Don Brown added a comment - 24/Sep/07 05:24 PM
Look in the com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor. All the ognl-related classes have been refactored to be in their own package and front-ended by interfaces to allow ognl to be replaced by a plugin, if desired.

Rainer Hermanns added a comment - 15/Oct/07 12:06 PM
XW-557 resolved the issue. Closing this as a dupe