You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Terje Hopsø <te...@online.no> on 2003/07/15 10:47:19 UTC

trigger an action from a filter?

Hello,
 
How can I call my actionservlet without using a FORM/SUBMIT? Can I trigger
it from a Filter-servlet and in that case how?
 
- Terje
 

Re: trigger an action from a filter?

Posted by Kris Schneider <kr...@dotech.com>.
Not sure if this is what Terje is after, but you can use a link instead of a form:

<html:link action="/action/path">...</html:link>

http://jakarta.apache.org/struts/userGuide/struts-html.html#link

As Max asked though, it would help to have some more detail on what the
requirements are.

Quoting Max Cooper <ma...@maxcooper.com>:

> You could send a redirect or forward the current request to the Struts
> action (mapping) from a Filter or Servlet.
> 
> What has lead you to want to do this? Perhaps a simpler solution to your
> functional needs is possible.
> 
> -Max
> 
> ----- Original Message ----- 
> From: "Terje Hopsø" <te...@online.no>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, July 15, 2003 1:47 AM
> Subject: trigger an action from a filter?
> 
> 
> > Hello,
> >
> > How can I call my actionservlet without using a FORM/SUBMIT? Can I
> trigger
> > it from a Filter-servlet and in that case how?
> >
> > - Terje

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: trigger an action from a filter?

Posted by Max Cooper <ma...@maxcooper.com>.
You could send a redirect or forward the current request to the Struts
action (mapping) from a Filter or Servlet.

What has lead you to want to do this? Perhaps a simpler solution to your
functional needs is possible.

-Max

----- Original Message ----- 
From: "Terje Hopsø" <te...@online.no>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, July 15, 2003 1:47 AM
Subject: trigger an action from a filter?


> Hello,
>
> How can I call my actionservlet without using a FORM/SUBMIT? Can I trigger
> it from a Filter-servlet and in that case how?
>
> - Terje
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: trigger an action from a filter?

Posted by Terje Hopsø <te...@online.no>.
I missed some of the understanding of how Struts works. I had a link (not in
a form) to a page where I wanted to get a resultset from my database first.
I had the logic in an actionServlet. The link activated the filter but not
the actionServlet. If I used a form with submit the actionServlet got
activated but not the filter. That's why I wanted to get the filter to
activate the actionservlet.

I have changed this now and move the logic into the filter an removed the
form/submit button and don't need a actionServlet for this link.

I am a novice to Struts at the moment and I am reading, trying and reading
the books again. 

- Terje



Not sure if this is what Terje is after, but you can use a link instead of a
form:

<html:link action="/action/path">...</html:link>

http://jakarta.apache.org/struts/userGuide/struts-html.html#link

As Max asked though, it would help to have some more detail on what the
requirements are.

Quoting Max Cooper <ma...@maxcooper.com>:

> You could send a redirect or forward the current request to the Struts
> action (mapping) from a Filter or Servlet.
> 
> What has lead you to want to do this? Perhaps a simpler solution to your
> functional needs is possible.
> 
> -Max
> 
> ----- Original Message ----- 
> From: "Terje Hopsø" <te...@online.no>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, July 15, 2003 1:47 AM
> Subject: trigger an action from a filter?
> 
> 
> > Hello,
> >
> > How can I call my actionservlet without using a FORM/SUBMIT? Can I
> trigger
> > it from a Filter-servlet and in that case how?
> >
> > - Terje


-----Original Message-----
From: Terje Hopsø [mailto:tehosubs@online.no] 
Sent: 15. juli 2003 10:47
To: Struts Users Mailing List
Subject: trigger an action from a filter?


Hello,
 
How can I call my actionservlet without using a FORM/SUBMIT? Can I trigger
it from a Filter-servlet and in that case how?
 
- Terje