• Post Reply Bookmark Topic Watch Topic
  • New Topic

request problems  RSS feed

 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
i am having a problem with my application and i cant find the reason!
i am using jsp and struts,and in my jsp register page i have a select dropdown list which is filled with values from my database.for this reason,in the action which links to that page i have used request.setAttribute("myList",myList).the values are shown correctly in dropdown lists but when submit button is selected,then i get the following message:

Cannot find bean: "myList" in any scope
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
at org.apache.jsp.user.register_jsp._jspService(register_jsp.java:706)....

does anyone know what might be the reason for that?
it also appears when i put in select the attribute scope="request"(well then its a bit different as it says cannot find bean "myList" in scope request!)am i missing something?
any help appreciated!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What resource gets control when you click the submit button? (probably controlled by the action of your form).
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the control then takes an Action which does the registration of the user and calls other functions too..is there something that i should include in that Action and i dont?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then what does the action do? Forward back to the register.jsp page?
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in case of a successful registration it forwards to another page (each page i am refering to consists of tiles).in case of a mistaken registration it forwards back to registration page and shows messages for the mistake (for example too few characters in name etc)..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you forward back to the registration page, are you setting up the list again?
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i wasn't!but i added the code and now everything works!
thank you very much for your help!!
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i did some additional tests and it turns out that it doesn't always work..when the user writes an invalid postal code for example (with more characters than allowed,acccording to my validation.xml) then it shows the same message..is there a logical explanation for this?and moreover is there something that can be done, so that not only the validation will work but this message won't appear as well?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!