Link to home
Start Free TrialLog in
Avatar of padmasambhava
padmasambhava

asked on

Using the session to pass variables from PHP to JSP

In some php code I store a variable with

$_SESSION['art']=$art;
Art is an array variable with file names in column 1.

How do I retrieve the variable with jsp

art = session.getAttribute("$art");

Seems to die and no output is generated.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rrz
You could send a request from your PHP to your JSP. The URL could look something like  
http://<host>/<context>/test.jsp?art=$art      
in  test.jsp  use  
<% 
   String art = request.getParameter("art");
%>
art is <%=art%>

Open in new window

or simply use  
art is ${param.art}

Open in new window

Thanks for the points -- it's a great question, ~Ray
Avatar of padmasambhava
padmasambhava

ASKER

Somehow I kinda wish I wasn't so good at generating "good" questions. LoL

Also I realized I can pass all of my array in less than 1500 bytes so no coding summer salts.

Thanks for all your help Ray.