You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shri <sd...@gresham-computing.com.au> on 2001/12/03 00:28:45 UTC

HTTP form based authentication

HI all,

When we follow HTTP form based authentication, for the form field we write:

<form method="POST" action="j_security_check">

( as per servlet specifications )

Using an action other than ".do" will break the action / action servlet
chain...

How to make this a part of action chain?

Any way of work around for this??

Shri

-----Original Message-----
From: Ted Husted [mailto:husted@apache.org]
Sent: Friday, 30 November 2001 8:19 AM
To: Struts Users Mailing List
Subject: Re: Hidden Field in a form. Do I use struts taglib or vanilla
html?


The cleanest thing is to put the ArrayList on the ActionForm. The syntax
of the options tag is suboptimal, so you need to expose the property as
a bean.

<html:select property="namesId">
<bean:define id="names" name="actionForm"
	property="names" type="java.util.Collection"/>
<html:options collection="names" property="value"
labelProperty="label"/>
</html:select>

So, you go through an Action, and have it setup the names list.

If there's validation involved, use the same Action as the input path,
so the list gets made again.

This also makes it much easier to retrieve the list from a database or
static class that is on the business tier.

David Lauta wrote:
>
> Wow,
> Thanks Ted this is great info.
>
> I have narrowed my problem down to:
> I want to use a <SELECT> Tag on a form and I want the options to be
> populated when the form is first displayed.
> To do this I need to set an ArrayList of valueLabel pairs in the page
Context
>
>  pageContext.setAttribute("names", actionForm.getNames());
> // getNames returns an ArrayList
> // each Item in the arrayList has a getValue() and getLabel() accessor.
> This works but is coded in the JSP ( tightly coupling the UI with the
Model ).
> I'm looking for a way to set the attribute outside of the JSP
> so that the following will work
>
>   <form:select
>    property="namesId"
>    onchange="javascript:submitForm()" >
>    <form:options collection="names" property="value" labelProperty="label"
/>
>   </form:select>
>
> In the sequence of events listed below when is the earliest that I can
obtain the
> pageContext
> to call the setAttribute() method on it. I'm guessing that the PageContext
of the JSP is
> the same as the
> ServletContext of the HTTPServlet
>
> Could my problem be related to I am using the ActionForm instead of the
ActionFormBean
> class?
>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>