This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes I want attach my own object also in...... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "I want attach my own object also in......" Watch "I want attach my own object also in......" New topic
Author

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

Huzefa Zohaib
Ranch Hand

Joined: Nov 21, 2001
Posts: 40
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

Joined: Nov 01, 2002
Posts: 363
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>
<%
}
%>


No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I want attach my own object also in......