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

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

View Questions and Answers by Category


Have Programming Question? Ask it here!

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

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";
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: