DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JSP (http://www.daniweb.com/forums/forum24.html)
-   -   How to pass the paramter from main JSP to the included JSP (http://www.daniweb.com/forums/thread129910.html)

arunagar Jun 18th, 2008 5:30 am
How to pass the paramter from main JSP to the included JSP
 
We have 2 JSPs

A.jsp ==> Main screen JSP
tabs.jsp ==> The jsp, which has the header and have several tabs

JSP 'A' "includes" JSP 'tabs'


Now I want that when page 'A.jsp' loads, it should make some check and set a Flag.
This Flag should pass to JSP 'tab.jsp', and based on it should enable some tabs and disable some tabs.


Problem is --
I am setting the flag in A.jsp and setting as hidden parameter.
in tabs.jsp i have using request.getParamter(), still there I am getting NULL


Even in A.jsp, I added this flag as param in include tag, and used getAttribute in tabs.jsp
Still its displaying NULL in tabs.jsp

How can I pass the value from main jsp to included jsp????

Thirusha Jun 23rd, 2008 6:38 am
Re: How to pass the paramter from main JSP to the included JSP
 
I am not yet an expert in jsp, but i think u have to submit the page before any of your parameters are set.

arunagar Jun 23rd, 2008 6:56 am
Re: How to pass the paramter from main JSP to the included JSP
 
Thanks Thirusha...
I used request.getAttribute() and request.setAttribute, to pass the values. It worked. :)


All times are GMT -4. The time now is 12:19 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC