alan do

Ranch Hand
+ Follow
since Apr 14, 2005
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by alan do

it's not WSAD. it's most likely your web.xml not having the proper servlet mapping for struts. you probably have something like


<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.*</url-pattern>
</servlet-mapping>


which makes EVERYTHING (bad, bad, slap) go through the action servlet. the correct url-pattern is *.do. see http://www.learntechnology.net/struts-lesson-1.do (web.xml section).
18 years ago
change your action mapping scope from 'session' to request.
18 years ago
you don't. the name attribute is automatically created based on the 'name' attribute of your action-mapping, which is the name of the associated form-bean.
18 years ago
it's not your action, but rather ActionServlet. your struts-config.xml is incomplete. you need to have the form-beans definition even if you are not definining any form-beans. search google for examples of how to define struts-config.xml properly.
18 years ago
should've been moved to struts.apache.org
18 years ago
oh, and the mask rule's error message can be customized to say whatever you want.
18 years ago
no custom validation necessary. use the 'mask' rule and check using this regex: ^[0-9]*$ .
18 years ago
after calling errors.add(), you must call the Action.saveErrors(request, errors) method to place the error into the request object. in your failure display page, add html:errors to show the error.
18 years ago
after fixing your datasource definition...like really pay attention to tag syntax, go to line 44 of your UserRegistrationAction.java and see what it's doing.
18 years ago
problem FOR struts is not a problem OF struts. you are absolutely correct that this is a problem, but it's not a flaw of struts. struts is a framework that structuralized and simplified your web application development. it's not set out to address every problem of basic web technologies, especially browser issues particular to the multiple sessions dependence on browser usage behaviors.

my suggestion is consider some workflow implementation in your app if you anticipate users opening multiple windows before completing an application/business path. see http://www.livinglogic.de/Struts/ for a struts implementation of workflow. honestly though, 90% of apps are not critical enough (or at least don't care too much) to enforce workflow across sessions if the users are 'odd' enough to launch multiple browsers to do the same thing.
18 years ago
sorry, i was away for training...
in your case, you can define your form validation properties using the object.propertyName. for example, if your form prop is
<form-property name="requestParams" type="my.custom.Object"/> which contains a 'firstName' field.

your validation definition should be
<field property="requestParams.firstName" depends="..."...> ... </field>. everything else is business as usual.
18 years ago
instead of hidden button, using javascript, you can detect event = '13' for the 'onkeydown' attribute of the password field (user has pressed 'enter') and do form.submit() when that occurs. if you're concerned about JS compatibility issues, i think you'll have that with about 1-5% of the users (unless everyone is using netscape on mac). in those cases, a the 'click on button' option is still available.
18 years ago
see front page of struts home page: http://struts.apache.org/
18 years ago