Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet How to communicate with different web applications ? ? ? ?

Have Programming Question? Ask it here!
 
 
 


srinivas
How to communicate with different web applications ? ? ? ?
1 Answer(s)      6 years and 3 months ago
Posted in : JSP-Servlet



Advertisement
View Answers

July 2, 2008 at 6:48 PM


To send session details from one JSP page to another JSP page you have to use session.putValue() method and after putting value send this to another JSP page by response.encodeURL("show.jsp") and at another page you have to get this putValue() into any variable like "String name =(String)session.getValue("name");" and print or use this in your page and to have this functionality in your JSP application you have to add "<%@ page session="true" %>" in your both JSP pages.

your display.jsp would be like this:---
<%@ page session="true" %>
<%
String name = "Kumar";
session.putValue("name",name);
String url =response.encodeURL("show.jsp");
%>
<a href='<%=url%>'>show.jsp</a>
-------------------------
show.jsp would be like this...

<%@ page session="true" %>

<%
String name =(String)session.getValue("name");
out.println("Name value in session is "+name);
%>


Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com