hi,
im quite new to this jsp. i want to know how to pass parameters from a java file to a jsp file? we can do this through java servlets, yet i have a doubt regarding passing the parameters. could you help me?

In your servlet you can write like this.

RequestDispatcher rd = request.getRequestDispatcher("yourPage.jsp");
request.setAttribute("paramName", "paramValue");
rd.forward(request, response);

and in "yourPage.jsp" you can get your parameter's value like this...

<%
   String yourValue = (String)request.getAttribute("paramName");
   System.out.println("yourValue  == "+);
%>

Hope this will help you. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.