Carsten,
Hi!
Thanks a lot for the response. I understand what you are saying. I am
including part of the java bean class code, so that maybe you can tell
something more what is wrong.

Interesting aspect of this problem is that when I set the _msg vairable
dynamically it is not being passed back to the jsp page, but it does
show up on the error_log file in JServ. On the browser I only see "null"
in place of the text from getMsg.

I am using the following code : (the jsp file code in further down below
in my earlier mail.

****** STRAT - PART OF JAVA BEAN CLASS SOURCE CODE *********

.......
.......
         if(req.getMethod().equalsIgnoreCase("post")) {
           if (req.getParameter("name1") != null){
             String name = req.getParameter("name1");
            _msg = "Hello "+name+" Now you have posted the page";
           }
           } else _msg = "You are running the page for the 1st time";
             System.err.println(_msg);
     try {

         //((com.sun.server.http.HttpServiceRequest)
req).setAttribute("hello", this);
         //((com.sun.server.http.HttpServiceResponse)
res).callPage(hello, req);

        String redirect = res.encodeRedirectUrl(hello);
        res.sendRedirect(redirect);

         } catch(Exception ex) {ex.getMessage();
System.out.println("JspFactory Exception Encountered");}
  }

  public void setMsg(String v) { _msg = v; }
  public String getMsg() {  return _msg; }
  private String _msg;
}

****** END - PART OF JAVA BEAN CLASS SOURCE CODE *********

Thanks a lot once again.
bye
Gaurav


Carsten Heyl wrote:
>
> Hi Gaurav,
>
> you can't pass parameters easily per request on jsdk 2.0.
> Jserv currently is jsdk 2.0 only.
> How do you set the bean attribute to the request?
> That should not work because the method for doing that was
> added in jsdk 2.1.
> You may pass beans by session scope. Use session object
> in servlet and session scope in jsp page.
>
> >Hi!
> >I have been trying to get rid of this problem for long, but not able to
> >solve it, kindly help.
> >
> >I have a servlet named HelloPage.class, which calls a jsp page and
> >simply displays it.
> >
> >But the problem is the jsp page fails to display the property
> >dynamically set in the servlet/bean, in the browser. Instead it displays
> >the initial value of the property (defined in the bean class), in the
> >JServe's error.log file.
> >
> >The jsp page which this class calls is as follows :
> >
> >****** START hello.jsp ****************
> >
> ><jsp:useBean id="helo" class="hello.HelloPage" create="yes"
> >scope="request" />
> ><jsp:setProperty name="helo" property="msg" param="name1" />
> >
> ><HTML><HEAD><TITLE>HELLO</TITLE></HEAD>
> >
> ><BODY><h1>Greetings</h1>
> >
> ><jsp:getProperty name="helo" property="msg" param="name1" />
> >
> ><form method="post" action="../servlets/hello.HelloPage">
> >
> >Enter Name : <%= helo.getMsg() %>
> >
> ><input type="text" name="name1" value="">
> >
> ><table><tr><td><input type="submit"
> >name="submit"></td></tr></table></form>
> >
> ></BODY></HTML>
> >
> >
> >******   END hello.jsp ****************
> >
> >I am using :
> >Aapache JServ 1.0b
> >GNUJSP1.0-cvs
> >
> >Any help is appreciated.
> >TIA
> >
> >--
> >Gaurav Kishore
> >
> >
> >--
> >--------------------------------------------------------------
> >Please read the FAQ! <http://java.apache.org/faq/>
> >To subscribe:        [EMAIL PROTECTED]
> >To unsubscribe:      [EMAIL PROTECTED]
> >Archives and Other:  <http://java.apache.org/main/mail.html>
> >Problems?:           [EMAIL PROTECTED]
> >
>
> Ciao,
>         Carsten Heyl
>
>   Carsten Heyl                          [EMAIL PROTECTED]
>   NADS - Solutions on Nets              http://www.nads.de/
>   NADS GmbH                             http://www.pixelboxx.de/
>   Hildebrandtstr. 4E                    Tel.: +49 211 933 02-90
> D-40215 Duesseldorf                     Fax.: +49 211 933 02-93

--
Gaurav Kishore
401K Forum Inc.
415-365-7612

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to