File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how to pass value from action to jsp scriplet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to pass value from action to jsp scriplet" Watch "how to pass value from action to jsp scriplet" New topic
Author

how to pass value from action to jsp scriplet

manish krishnan
Greenhorn

Joined: May 11, 2010
Posts: 26
hi

i m facing a big problem.. please help me.

i have an action which contains a variable that contains value from database. now i want to assign the action variable value to a jsp page local variable initialized in scriplet.

for ex

action.java


result.jsp


i want to how value of 'a' can be assigned to 'b'

Thanking
Manish
sri ramvaithiyanathan
Ranch Hand

Joined: Nov 20, 2010
Posts: 109
Hi,

int a=10;
String setValue = Integer.toString(a);
set the converted value into request.setAttribute("dummyName",setValue);
In jsp page you can get the value by calling the request.getAttribute("dummyName");

I'm not sure whether integer can be used to set in request.setAttribute so that i converted int into String.

Regards,
Sriram.V


For java examples,ebooks,interview questions,visit this blog
http://periodicupdates.blogspot.com/
manish krishnan
Greenhorn

Joined: May 11, 2010
Posts: 26
thanks
 
 
subject: how to pass value from action to jsp scriplet