File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want attach my own object also in......

 
Huzefa Zohaib
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want send the message also in the following code.

String message= "Id is assigned";
try {
url= "/jsp/Mb/SignUp.jsp";
rd= context.getRequestDispatcher (url);
rd.forward (req, res);
}catch (Exception ee) {out.println (ee); ee.printStackTrace ();}
How can I do so?
 
Scott Duncan
Ranch Hand
Posts: 364
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it would have to be in the request or the req object in the case of your code.
In the servlet:
req.setAttribute("message", message);
in the SignUp.jsp you need something like:
<%
String message = (String)request.getAttribute("message");
if( message != null ){
%>
<font color=red><i><b><%=message%></b></i></font><br><br>
<%
}
%>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic