You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Nanduri, Amarnath" <Am...@Agilquest.com> on 2001/04/05 22:08:04 UTC

html:submit tag question


Hi all,

      Is it possible to convert the below HTML into a struts tag ? Thanks
for your information.

<input type="submit" name="<%= Constants.SEARCH %>" value="<bean:message
key="searchResource.search"/>" >    	


  p.s All names are declared in a Constants file so that they can be
accessed in a uniform way across the application.


cheers,
Amar..

RE: intercepting requests

Posted by Robert Taylor <rt...@mulework.com>.
I believe the new Servlet API2.3  has a filtering mechanism for this
functionality.
from
http://developer.java.sun.com/developer/technicalArticles/Servlets/servletap
i2.3/

<snippet>
Filters
The most significant part of API 2.3 is the addition of filters -- objects
that can transform a request or modify a response. Filters are not servlets;
they do not actually create a response. They are preprocessors of the
request before it reaches a servlet, and/or postprocessors of the response
leaving a servlet. In a sense, filters are a mature version of the old
"servlet chaining" concept. A filter can:

-Intercept a servlet's invocation before the servlet is called
-Examine a request before a servlet is called
-Modify the request headers and request data by providing a customized
version of the request object that wraps the real request
-Modify the response headers and response data by providing a customized
version of the response object that wraps the real response
-Intercept a servlet's invocation after the servlet is called

You can configure a filter to act on a servlet or group of servlets; that
servlet or group can be filtered by zero or more filters. Practical filter
ideas include authentication filters, logging and auditing filters, image
conversion filters, data compression filters, encryption filters, tokenizing
filters, filters that trigger resource access events, XSLT filters that
transform XML content, or MIME-type chain filters (just like servlet
chaining).
</snippet>

HTH,

Robert


> -----Original Message-----
> From: Payam Mirrashidi [mailto:payam@mirrashidi.com]
> Sent: Thursday, April 05, 2001 11:09 PM
> To: struts-user@jakarta.apache.org
> Subject: intercepting requests
>
>
>
> What mechanism should be used to intercept all requests in a struts
> application? I'm looking for something similar to a Tomcat
> RequestInterceptor but applicable only to a specific
> ServletContext. I want
> to be able to do some housekeeping before the first call to
> servlet.service() for that request. That is, I want to insert some logic
> before any of my business logic is called, be it in the form of an
> ActionForm, an Action, a servlet or just a .jsp page.
>
> Specifically, what I'm trying to do is to insert some global sanity checks
> on the request before any ActionForm validate() methods are called. Of
> course, I want the same checks performed before any .jsp rendering or any
> servlet.service() calls. One way to do this would be to subclass
> ActionServlet and insert some checks there and also have all .jsps and
> servlets call that same code before doing anything.
>
> Is there a better way? Ideally, I wouldn't have to manually have
> to add all
> the calls to the sanity checker.
>
> ----
> Payam Mirrashidi
> payam@mirrashidi.com
>
>
>
>
>


intercepting requests

Posted by Payam Mirrashidi <pa...@mirrashidi.com>.
What mechanism should be used to intercept all requests in a struts
application? I'm looking for something similar to a Tomcat
RequestInterceptor but applicable only to a specific ServletContext. I want
to be able to do some housekeeping before the first call to
servlet.service() for that request. That is, I want to insert some logic
before any of my business logic is called, be it in the form of an
ActionForm, an Action, a servlet or just a .jsp page.

Specifically, what I'm trying to do is to insert some global sanity checks
on the request before any ActionForm validate() methods are called. Of
course, I want the same checks performed before any .jsp rendering or any
servlet.service() calls. One way to do this would be to subclass
ActionServlet and insert some checks there and also have all .jsps and
servlets call that same code before doing anything.

Is there a better way? Ideally, I wouldn't have to manually have to add all
the calls to the sanity checker.

----
Payam Mirrashidi
payam@mirrashidi.com




Re: html:submit tag question

Posted by Jim Crossley <jc...@ifleet.com>.
I *think* this is the struts equivalent:

<html:submit property="<%=Constants.SEARCH%>">
  <bean:message key="searchResource.search"/>
</html:submit>

You may be able to get by without the property attribute, though.

"Nanduri, Amarnath" wrote:
> 
> Hi all,
> 
>       Is it possible to convert the below HTML into a struts tag ? Thanks
> for your information.
> 
> <input type="submit" name="<%= Constants.SEARCH %>" value="<bean:message
> key="searchResource.search"/>" >
> 
>   p.s All names are declared in a Constants file so that they can be
> accessed in a uniform way across the application.
> 
> cheers,
> Amar..