I bet your missing the JSTL taglib directive in your page.
Try adding 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> 
and then your <c:xxxxx .../> actions will work.

> -----Original Message-----
> From: Caroline Jen [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 17, 2003 9:45 PM
> To: Struts Users Mailing List
> Subject: RE: How To Output the Value of a String That Is Passed From
> Another JSP?
> 
> 
> Thanks for your advice.  I did this in my view.jsp:
> 
> <html:form action="/list/Message">
> <c:set var="cr" value="${articleForm.creator}"
> scope="session"/>
> <c:out value="${cr}"/>
> <html:submit>View/Send Messages</html:submit>
> </html:form>
> <bean:write name="articleForm" property="creator"/>
> 
> I was able to see the "View/Send Messages" button
> displayed.  And the <bean:write name="articleForm"
> property="creator"/> also wrote out the value of the
> property "creator".
> 
> Now, the question is 
> 
> 1. why the <c:set var="cr"
> value="${articleForm.creator}" scope="session"/> did
> not put the value in the session scope?  
> 
> 2. What is wrong with the <c:set .... > tag?  
> 
> 3. What should I do if I want to put the value of
> "creator" in a session scope?
> 
> -C
> 
> 
> --- Robert Taylor <[EMAIL PROTECTED]> wrote:
> > Are you sure that <c:set var="cr"
> > value="${articleForm.creator}"
> > scope="session"/>
> > is placing the value in the intended scope?
> > 
> > Try doing this:
> > 
> > <html:form action="/list/Message">
> > <c:set var="cr"
> > value="${articleForm.creator}"scope="session"/>
> > <c:out value="${cr}"/>
> > <html:submit>View/Send Messages</html:submit>
> > </html:form>
> > 
> > To make sure it is actually putting the value in
> > session scope.
> > 
> > If so, then on postForm.jsp try using scriplets to
> > make sure that
> > the value can be accessed. If it can, then do you
> > have all of your
> > tag library directives in your pages?
> > 
> > robert
> > 
> > > -----Original Message-----
> > > From: Caroline Jen [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, December 17, 2003 8:40 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: How To Output the Value of a String
> > That Is Passed From
> > > Another JSP?
> > >
> > >
> > > "cr" is not a form and there is no action
> > involved.
> > > There are two JSPs; view.jsp and postForm.jsp and
> > each
> > > is with its own form (different forms).
> > >
> > > In my view.jsp, I am able to write out String
> > creator
> > > this way:
> > > <bean:write name="articleForm"
> > property="creator"/>
> > > and I put the String creator in a session object:
> > >
> > >    <html:form action="/list/Message">
> > >    <c:set var="cr" value="${articleForm.creator}"
> > > scope="session"/>
> > >    <html:submit>View/Send Messages</html:submit>
> > >    </html:form>
> > >
> > > and in the postForm.jsp, I retrieve the String and
> > try
> > > to write it out in a text field:
> > >
> > >       <bean:define id="author" name="cr"
> > > scope="session" type="java.lang.String"/>
> > >       <html:text property="creator"
> > > value="<%=author%>" size="82" maxlength="25"
> > > tabindex="1"/>
> > >
> > > I got this error message:
> > > ServletException in:/article/content/postForm.jsp]
> > > > Cannot find bean cr in scope session'
> > >
> > > -Caroline
> > > --- David Friedman <[EMAIL PROTECTED]> wrote:
> > > > Caroline,
> > > >
> > > > How do you save the form "cr" in session scope?
> > > > Does your action use 'scope="session"' or are
> > you
> > > > doing a
> > > > 'request.getSession().setAttribute("cr",cr);'
> > > > in the first action?
> > > >
> > > > Regards,
> > > > David
> > > >
> > > > -----Original Message-----
> > > > From: Caroline Jen [mailto:[EMAIL PROTECTED]
> > > > Sent: Wednesday, December 17, 2003 8:25 PM
> > > > To: Struts Users Mailing List
> > > > Subject: RE: How To Output the Value of a String
> > > > That Is Passed From
> > > > Another JSP?
> > > >
> > > >
> > > > Hi, my JSP#1 and JSP#2 use different forms.
> > > > However,
> > > > property name in JSP#1 is the same as that in
> > JSP#2.
> > > >
> > > > I tried to pass this Sring and write it out in a
> > > > text
> > > > field in JSP#2 and just could not get it right. 
> > I
> > > > got
> > > > this error
> > > > message:
> > > >
> > > > [ServletException
> > in:/article/content/postForm.jsp]
> > > > Cannot find bean cr in scope session'
> > > >
> > > > In my view.jsp, I put a String in a session
> > object:
> > > >
> > > >    <html:form action="/list/Message">
> > > >    <c:set var="cr"
> > value="${articleForm.creator}"
> > > > scope="session"/>
> > > >    <html:submit>View/Send Messages</html:submit>
> > > >    </html:form>
> > > >
> > > > And in postForm.jsp, I tried to retrieve that
> > String
> > > > and write it out in a text field this way:
> > > >
> > > >       <bean:define id="author" name="cr"
> > > > scope="session" type="java.lang.String"/>
> > > >       <html:text property="creator"
> > > > value="<%=author%>" size="82" maxlength="25"
> > > > tabindex="1"/>
> > > >
> > > > -Caroline
> > > >
> > > > --- Robert Taylor <[EMAIL PROTECTED]> wrote:
> > > > > There are a couple (3) ways to do it.
> > > > >
> > > > > 1. Have both JSP#1 and 2 use the same form
> > then
> > > > have
> > > > > the action that
> > > > > processes JSP#1 simply
> > > > > forward to JSP#2 and Struts will auto-populate
> > the
> > > > > field.
> > > > >
> > > > > 2. Have the action that processes JSP#1
> > forward or
> > > > > redirect to
> > > > >    JSP#2 whose form has the same property
> > name.
> > > > > Place the create property
> > > > >    value in the query string and Struts will
> > > > > auto-populate the form
> > > > >    in JSP#2.
> > > > >
> > > > > 3. Have the action that processes JSP#1 access
> > and
> > > > > populate the form used
> > > > >    in JSP#2 with the property then forward to
> > > > JSP#2.
> > > > >
> > > > > robert
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Caroline Jen
> > [mailto:[EMAIL PROTECTED]
> > > > > > Sent: Tuesday, December 16, 2003 8:33 PM
> > > > > > To: [EMAIL PROTECTED]
> > > > > > Subject: How To Output the Value Of a Hidden
> > > > > Field?
> > > > > >
> > > > > >
> > > > > > My JSP #2 receives a hidden field passed
> > from
> > > > JSP
> > > > > #1:
> > > > > > <html:hidden property="creator"/>
> > > > > >
> > > > > > In the JSP #2, I have a text field:
> > > > > > <html:text property="creator" size="82"
> > > > > maxlength="25"
> > > > > > tabindex="1"/>
> > > > > >
> > > > > > and I want the value of the hidden field to
> > be
> > > > the
> > > > > > text in the text field of the JSP #2. 
> > Please
> > > > > advise
> > > > > > how to do it?
> > > > > >
> > > > > > __________________________________
> > > > > > Do you Yahoo!?
> > > > > > New Yahoo! Photos - easier uploading and
> > > > sharing.
> > > > > > http://photos.yahoo.com/
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > > [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail:
> > 
> === message truncated ===
> 
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to