SSI and JSP : problem with getParameter
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Damien_Tatangelo
Posted On:   Thursday, May 13, 2004 09:46 AM

Hi there, I'm a newbie using this wonderful JSP.. and you know what ?! I've got a problem.. !! I'm using SSI to include some stuff and my JSP page : The shtml file and the jsp are parsed and i can see the result... Here's now the problem, in the jsp file i need to access the parameter of the shtml file. In my browser I use : http://mysite.com/index.shtml?p=1 And i wanna be able to get the value of the "p" in the JSP file. I've tried : <% String test= new String(getParameter("p")); %> but it fires out an error. Is it possible to do so ? May it come from my tomcat config fi   More>>

Hi there,



I'm a newbie using this wonderful JSP.. and you know what ?! I've got a problem.. !!



I'm using SSI to include some stuff and my JSP page :




The shtml file and the jsp are parsed and i can see the result...

Here's now the problem, in the jsp file i need to access the parameter of the shtml file.


In my browser I use : http://mysite.com/index.shtml?p=1



And i wanna be able to get the value of the "p" in the JSP file.


I've tried :


<% String test= new String(getParameter("p")); %>


but it fires out an error. Is it possible to do so ? May it come from my tomcat config file ?



I use Tomcat 5.0.19 with JDK 1.4.2_04



Thanks for your help folks.    <<Less

Re: SSI and JSP : problem with getParameter

Posted By:   Sean_Owen  
Posted On:   Thursday, May 13, 2004 10:32 AM

I don't know much about SSI, but possibly enough to answer your question.



First, what is the error? That test is null?



While the request for index.shtml gets the request parameter "p=1", I wouldn't guess that the server would pass that along to testjsp/menu.jsp when it does the include. I'm not sure if there is a setting that will cause that to happen or not, but that's why.



Why not make all your pages JSPs and use JSP includes? That will work as you expect.

About | Sitemap | Contact