0

How can I enter a Servlet right after entering the JSP page? Is it possible to get the requested parameters in the current page after entering the Servlet? After clicking an anchor tag, I want to get information using Servlet to my current JSP file. How do I that? What do I have to add in my anchor tag before going to my desired page?

Current page - Profile.jsp

<a href="Profile.jsp">View Profile</a>    
<a href="ReportGeneration.jsp">View Report Generation</a>
<a href="Contact.jsp">Contact Us</a>

Desired page - ReportGeneration.jsp Servlet - ReportProcess.java

I want to print the information from ReportProcess servlet to ReportGeneration.jsp when "View Report Generation" tag is clicked.

ss1
  • 43
  • 7

1 Answers1

0

Include the servlet result into the ReportGeneration.jsp like this

<jsp:include page="/ReportProcess" /> 

here ReportProcess consider as a servlet URL in this area you will get the servlet output in this tag area

if you want the servlet output in profile.jsp

instead of this

<a href="ReportGeneration.jsp">View Report Generation</a>

use this

<jsp:include page="/ReportProcess" /> 

as suggested by @Scary Wombat

Ashok Kumar N
  • 573
  • 6
  • 23