• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to access hidden value set in jsp in EJB method

 
kesava chaitanya
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from jsp i am calling a ejb bean method like this

remote.newPassword(id,oldpwd,location,dept,phrase).i am calling the same method in different jsp's also.

if i am calling this method from changeProfile screen.

i want to put hidden parameter in the changeProfile jsp so that i can differentiate different screens .i can manipulate in the bean method .

if i put hidden parameter in the changeProfile jsp how can i access that hidden value in ejb bean.

if jsp is accessing servlet then in servlet i can access request.getParameter("");

dont tell me change remote interface method arguments.
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

dont tell me change remote interface method arguments.


hmmm....you shouldnt really be making such remarks while posting a question.
This forum is pretty friendly, so you should get away with it, but be aware that it doesnt reflect well.

As for the question itself, you cannot access request objects in your ejbs. Neither should you pass the request object to the ejb layer - you should retrieve the data in a servlet, create a model out of it and pass the model bean to the ejb as a parameter. The ejb can examine the bean properties and take neccessary action.

Given your 'instruction' to people who post - 'dont tell me to change method arguments', what you can do is have an overloaded method with the extra args


Lastly you may want to re-examine your design where you have one jsp serving multiple pages or processing multiple requests based on a hidden parameter.

You could have a servlet that does the job of request processing rather than a jsp.

cheers,
ram.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kesava chaitanya:
if jsp is accessing servlet then in servlet i can access request.getParameter("");

Yes, getParameter works with hidden HTTP form fields.
They're only hidden from the web user.

dont tell me change remote interface method arguments.
If that is the correct answer, that is the answer that will be given.
More likely, however, an order like that will encourage people to skip this thread altogether.

Additionally, Ramprasad's refactoring suggestions are valid.
It would be wise to consider them.
[ August 30, 2005: Message edited by: Ben Souther ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!