Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why resutl name='input' dose not work

 
heng zhang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a simple action. the configuration is below


when i enter the URL in the browser: http://localhost:8080/DonorRegistration/donor/dr.action

it directly went to the thank you page, which is result name='success'.
to my understanding, the input page should show up first.

do I do something wrong?

Thanks
Heng
 
Ankit Garg
Sheriff
Posts: 9597
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you return input mapping from your action?? Input page will be shown in cases when some input is missing (or validation fails). Like if your action is expecting a name and password and if you invoke your action without it, then the input page will be shown (if you've applied validations)...
 
heng zhang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well,
i am a little confused about the behavior of this code:
<result name="input">/jsp/donor-signup.jsp</result>

donor-signup.jsp is the input form of the action class DonorRegistration.
so when i enter:
http://localhost:8080/DonorRegistration/donor/dr.action

first , perpare method is invoked. then donor-signup.jsp shows up
then i fill up the form and hit submit, execute method of DonorRegistion is involked.
then thank you page shows up.

i thought <result name="input"> defines the first input page of the action,which shows up before the execute method returns.

in my action, it returns success.

my understanding to <result name="input"> is right?

Thanks
 
heng zhang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok! fixed.

if you want to get the behavior i want, you need implement validation for that action by either creating a xml file or implementing validate method.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!