The html tags are designed to display what's in a related ActionForm
bean. So the trick would be to get your String into the ActionForm bean.
The place to do this would be in an Action that then forwarded to your
JSP. So the Action would go something like this:

        HttpSession session = request.getSession();
        YourBean yourBean = (YourBean)
                session.getAttribute("yourBean");

        YourForm yourForm = (YourForm) form; 
        yourForm.setWhatever(yourBean.getWhatever());

        return (findForward("success"));

You could use the same Action to handle the submit from the form, either
by keying on a value in the form or by submitting to another Action
Mapping with a different parameter property.

If you don't need to display them in a HTML form, then you can just use
the bean:write tag and specify the property you want to write (assuming
it has a getYyyy accessor). 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


James Howe wrote:
> This is probably a stupid question, but here it goes.  I have a handful of
> string values that I'm storing in the session object.  These values aren't
> associated with any "bean" (actually, in a sense the session object is the
> bean).  I have a couple of places where I need to display these values in a
> form.  I want to use the <html:text> tag, but I don't know what I need to
> specify.  Let me give an example.  Suppose I have a String value stored in
> the session by the name of "filter".  How would I get the "filter" value to
> display in a form text field?

Reply via email to