dcsimg
<P><br>getAttribute(String s) is not working with my application. Why??</P></BR>
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jeya_Selliah
Posted On:   Friday, February 22, 2002 09:00 AM

This is my program: public void doPsot(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { HttpSession session = req.getSession(); res.setContentType("text/html"); PrintWriter out = res.getWriter(); String btn = req.getParameter("btn"); String gotoPage = ""; String btn_name = session.getAttribute("btn"); if ((btn_name==null) || (btn_name.length()==0)){ gotoPage = "/agreement.jsp"; } out.close(); } I am using Visual age for java to write servlet codes and Websphere to write jsp codes. I have imported all the javax.servlet.   More>>



This is my program:

			
public void doPsot(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {

HttpSession session = req.getSession();

res.setContentType("text/html");
PrintWriter out = res.getWriter();

String btn = req.getParameter("btn");
String gotoPage = "";

String btn_name = session.getAttribute("btn");
if ((btn_name==null) || (btn_name.length()==0)){
gotoPage = "/agreement.jsp";
}
out.close();
}

I am using Visual age for java to write servlet codes and Websphere to write jsp codes. I have imported all the javax.servlet.* and javax.servlet.http.*. Can you tell me why I couln't execute the getAttribute method?
   <<Less

Re: <P><br>getAttribute(String s) is not working with my application. Why??</P></BR>

Posted By:   Anonymous  
Posted On:   Friday, February 22, 2002 09:37 AM

Have you copied and pasted that method?

If so, it would be not executed... the name doPsot is not correct.


Regards

Re: <P><br>getAttribute(String s) is not working with my application. Why??</P></BR>

Posted By:   travis_woods  
Posted On:   Friday, February 22, 2002 09:06 AM

whats the error?? null pointer?

and what line is it giving you the error on?

do you have a "btn" in the session and in the query string or in a hidden ?
About | Sitemap | Contact