Hi Rafael,
instead forward name="success" path="/MainMenu.class"
write forward name="success" path="/MainMenu.do".
Best greetingsgus.
,
Paweł Wiel
2009/12/16 Rafael Muneton :
>
> Hello:
>
>
>
> I am trying to develop a small application that contains a Login.jsp, in case
> of failure the contro
Hello:
I am trying to develop a small application that contains a Login.jsp, in case
of failure the controller must redirect to Login.jsp again; in case of
success the controller must redirect to a Java application ,MainMenu.class.
I think this is done in struts-config.xml file:
by the idea of Convention-plugin(CodeBehind-plugin)--"Zero Config",it provides:
Action location by package naming conventions
Result (JSP, FreeMarker, etc) location by naming conventions
Class name to URL naming convention
Package name to namespace convention
SEO compliant URLs (i.e. my-action
xnpeng wrote:
public class PublishController extends PublishAction implements Preparable {
private static String message_url = "/post/message/";
private static String affair_url = "/post/affair/";
private static String business_url = "/post/business/";
private static String activi
so many thanks.
forgive my poor english.
there are some words in this document:
http://struts.apache.org/2.1.6/docs/rest-plugin.html
Also, notice we aren't returning the usual "success" result code in either
method. This allows us to use the special features of the Codebehind Plugin to
intui
I'm not sure I understand your problem. Maybe you can give an example?
I would be surprised if you couldn't handle this with regular Struts 2
results.
http://struts.apache.org/2.1.6/docs/result-types.html
http://struts.apache.org/2.1.6/docs/result-configuration.html
http://struts.apache.org/2.1.6/
thanks for your reply.
the result types cannot do my jobs in struts2+rest environment. in this
environment, the "success","error",... did not work, only "index","show" ,...
are the default result types. I can manage this.
my situation is, I need to forward request to action conditionally,ie,de
Why do you need to do it manually with the request dispatcher? Can't
you use any of the available result types?
http://struts.apache.org/2.1.6/docs/result-types.html
Nils-H
2009/4/29 xnpeng :
> from:
>
> ServletActionContext.getServletContext().getRequestDispatcher("/post/message/"+id).forward(S
from:
ServletActionContext.getServletContext().getRequestDispatcher("/post/message/"+id).forward(ServletActionContext.getRequest(),ServletActionContext.getResponse());
I want to forward request to http://localhost:8080/post/message/3166,
but it always throws out exception says requested resource
rs from
> Action-A to be present in the view of URL-B.
>
> How do I do this? It used to be simple in Struts-1, but I can't figure it
> out for Struts2.
>
> Thanks,
>
> Alex
>
--
View this message in context:
http://www.nabble.com/-S2--How-to-forward-to-another-str
used to be simple in Struts-1, but I can't figure it
out for Struts2.
Thanks,
Alex
--
View this message in context:
http://www.nabble.com/-S2--How-to-forward-to-another-struts-mapping-tf4846285.html#a13865418
Sent from the Struts - User mailing list archive at
There's no perfect solution. You should choose a first-win or last-win
strategy.
Paul
On 10/1/07, Anton Pussep <[EMAIL PROTECTED]> wrote:
>
> First of all thanks a lot for the fast reply.
>
> The problem with storing something in the session is it that if the user
> tried to access two different
First of all thanks a lot for the fast reply.
The problem with storing something in the session is it that if the user
tried to access two different pages at once in separate windows and had
to login in both, he will be forwarded in both to the last page he tried
to access. I think this is a quite
Anton,
Acegi Security does something similar. The original requests (yes -- the
actual request object) is stored in the session when the user's credentials
are challenged. If they then succeed at the login page, the original request
is taken from the session and forwarded along.
Paul
On 9/30/07,
I spent quite a few hours today trying to forward the user to his
original destination when he has to login in between.
I have an interceptor (Authentication) that is called before an action
and it forwards to Login.action if the user is not logged in. The
problem is that if Login.action returns S
If you configure your web applications so that the context is shared
then you will be able to get resources from the other web applications.
See for more details the documentation for the web application context
configuration (context.xml).
As Struts uses standard RequestDispatcher, then you shou
can't you use a redirect? i think you can't forward outside the same
context (but i'm not sure, maybe some servlet containers can do it).
El lun, 10-09-2007 a las 17:45 -0700, [EMAIL PROTECTED]
escribió:
> Hi,
>
> The present application structure has multiple .war files in a .ear file.
> Now my
Hi,
The present application structure has multiple .war files in a .ear file.
Now my login module is part of 1.war and on a successful validation i want
to forward in struts-config.xml to a page in 2.war file.
How do i achieve this?
Thank you
ue;
> if(val == 1){
> [b]mypage.do[/b] //<--- this is how i needed
> }
> }
>
>
>
> one
> one
> one
>
>
>
>
> thx in Adv
> Ajay
> --
> Vi
ent: Wednesday, August 08, 2007 8:47 AM
To: user@struts.apache.org
Subject: how to forward some action from javascritp
hi i have to forward to controller with javascritp my script is as below.
function fwd(field){
var val=field.value;
if(val == 1){
[b]mypage.do[/b] //<
ttp://www.nabble.com/how-to-forward-some-action-from-javascritp-tf4234069.html#a12046424
Sent from the Struts - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EM
Sorry for taking so long to get back to everyone on this. This is a side
project of mine and things have been hectic with the day job keeping me from
this.
After doing some experimentation, I've found that your solution below does
work Musachy. It just won't access a property in the request att
%{expr} won't work (yet). I modified EditPersonAction on showcase to this:
@Result(name="list", value="${next}", type=ServletRedirectResult.class)
public class EditPersonAction extends ActionSupport {
...
public String getNext() {
return "listPeople.action";
}
public String execute() t
--- Caine Lai <[EMAIL PROTECTED]> wrote:
> @Result(name=Action.SUCCESS,
> value="/resources/${resource}.ftl",
> type=FreemarkerResult.class)
> Am I missing something?
Did you try using OGNL syntax, like %{resource}.ftl?
d.
__
Do Y
Thanks again for your help. So perhaps I'm not understanding how to get
this to work. In my action I have this mapping:
@Result(name=Action.SUCCESS, value="/resources/${resource}.ftl", type=
FreemarkerResult.class)
And in my execute method I have:
request.setAttribute("resource", "myPage");
I haven't tried myself but the annotations for results should work just
like regular xml-configured results.
musachy
On 5/9/07, Caine Lai <[EMAIL PROTECTED]> wrote:
Thanks Musachy,
But how would one do this if they were using Struts 2 annotations to map
their action classes? Is it possible?
Thanks Musachy,
But how would one do this if they were using Struts 2 annotations to map
their action classes? Is it possible? Or am I stuck with using XML for
this one action?
Thanks,
Caine
On 5/9/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
You can use OGNL expressions in the result pat
Very good; I thought there had been discussion about
that :)
--- Musachy Barroso <[EMAIL PROTECTED]> wrote:
> I was just leaving a message to Rainer on:
>
> https://issues.apache.org/struts/browse/WW-1879
>
> I submitted the patch just a few minutes before the
> xwork build, and he
> wasn't sur
I was just leaving a message to Rainer on:
https://issues.apache.org/struts/browse/WW-1879
I submitted the patch just a few minutes before the xwork build, and he
wasn't sure if it was going to break something else (coming from me I can
understand that :) )
musachy
On 5/9/07, Dave Newton <[EMA
--- Musachy Barroso <[EMAIL PROTECTED]> wrote:
> just make sure that you use ${expression}, instead
of
> %{expression}
(Was someone going to make a change for that so the
config EL is the same as the normal OGNL? I think it'd
be nice and less confusing if they were unified :)
d.
You can use OGNL expressions in the result path, just make sure that you use
${expression}, instead of %{expression}, like
${forwardTo}
musachy
On 5/9/07, Caine Lai <[EMAIL PROTECTED]> wrote:
Does anyone know how I can forward to a .jsp file based on a dynamic
attribute (request paramete
Does anyone know how I can forward to a .jsp file based on a dynamic
attribute (request parameter)?
I want to write a Struts 2 action that will forward the user to a .jsp
dynamically. The flow works like so:
1. A request is made for 'resourceLocator.action?resource=common'.
2. The resourceLocat
Hi,
In struts, I have an action Act1 that forwards to a display page Page1. On that
page there is a submit button whose action act2 forwards to display page Page2.
I need to modify Page1 in such a way that I add an additional submit button
whose action Act1A forwards to display page Page1A. On
Dakota Jack wrote the following on 1/7/2006 10:09 AM:
In my opinion, Eric, this is a bad solution. There are lots of reasons this
is bad. Rather than go through them, I would suggest you just add the logic
in /search.do?query=42 at the point you get the failure form
/retrieve.do?id=42.
I agre
In my opinion, Eric, this is a bad solution. There are lots of reasons this
is bad. Rather than go through them, I would suggest you just add the logic
in /search.do?query=42 at the point you get the failure form
/retrieve.do?id=42.
On 1/7/06, Eric Jain <[EMAIL PROTECTED]> wrote:
>
> If a reques
If a request for
/retrieve.do?id=42
fails (e.g. couldn't find item in database), I'd like to say
request.setStatus(HttpServletResponse.SC_NOT_FOUND);
request.setAttribute("warning", "Not your lucky day.");
and forward (not redirect) the request to
/search.do?query=42
Can this behavio
I have jsp1 with 2 buttons.(OneAction, OneForm) along with it. One.do
defined action.
I have defined in struts.config to forward to jsp1 with tiles
definition.
I have jsp2 with 2 buttons.(TwoAction, TwoForm defined with it.)Two.do
defined action.
I have defined in struts.config to forward to jsp2
In struts you can redirect(not forward) to other page or site.
In your action instead of mapping.findforward use following code
ActionForward toAction= new ActionForward ();
ActionForward fromAction = mapping.findForward("targetURL");
toAction.setPath(fromAction.getPath());
toAction.set
Configure an Action Mapping like so:
http://www.omnytex.com"; redirect="true"
/>
That's all. If you need it to be a little more dynamic, like I notice you said
it was on the same server, if it might be moved from server to server, than get
a reference to the forward above in your Action,
From: "Michael Oliver" <[EMAIL PROTECTED]>
> Thanks except in your example your forward isn't "outside" it is to an
> action in that struts application, I want to go to a URL outside the
> application, elsewhere on the same server but not to an action or jsp
> page.
Do the redirect yourself, and r
uary 27, 2005 12:11 PM
To: Struts Users Mailing List
Subject: Re: How to Forward out of struts to a URL from an Action
Hi Michael,
have a look in your struts-config.xml.
Greets Mark
Michael Oliver wrote:
>I would like to forward the user out of struts to a URL after
Hi Michael,
have a look in your struts-config.xml.
Greets Mark
Michael Oliver wrote:
I would like to forward the user out of struts to a URL after an action
executes without additional user input, what is the best way in Struts?
I can use a page that has a redirect javascript in it,
Your action should choose a forward with its redirect attribute set to true:
Thanks,
Paul
-Original Message-
From: Michael Oliver [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 27, 2005 2:54 PM
To: struts-user@jakarta.apache.org
Subject: How to Forward out of struts to a URL from
I would like to forward the user out of struts to a URL after an action
executes without additional user input, what is the best way in Struts?
I can use a page that has a redirect javascript in it, but is there a
facility in Struts to do this?
Michael Oliver
CTO
Alarius Systems LLC
3325 N.
t: Re: How to forward to an Action in one web app, from the Action
ofa different web app
Frank L. Bowar wrote:
>I have 3 different Struts (1.1) web applications all running in the
>same Tomcat (4.1) server. When the user presses a button on a form of
>one of the applications, tied to a St
Frank L. Bowar wrote:
I have 3 different Struts (1.1) web applications all running in the same
Tomcat (4.1) server. When the user presses a button on a form of one of
the applications, tied to a Struts Action, I would like that Action to
be able to forward control to an Action within a different w
I have 3 different Struts (1.1) web applications all running in the same
Tomcat (4.1) server. When the user presses a button on a form of one of
the applications, tied to a Struts Action, I would like that Action to
be able to forward control to an Action within a different web
application, which w
Riyad Kalla wrote:
booya I really appreciate the code snippets and explination! I hadn't gotten
involved in ActionForwards and appreciate you shedding light on the situation
for me.
No problems Riyad! I'm glad to give back to this list after sucking it
dry for three months ;-)
--
bOOyah
-
booya I really appreciate the code snippets and explination! I hadn't gotten
involved in ActionForwards and appreciate you shedding light on the situation
for me.
Best,
Riyad
On Friday 23 April 2004 09:34 am, bOOyah wrote:
> Riyad Kalla wrote:
>
>
>
> > Does anyone know how I would be able to
Riyad Kalla wrote:
UPDATE:
Upgraded my Struts install to nightly build and now the code snippet
below works. I'm still curious if anyone knows how one LDA can forward
to another (or the same) LDA, even if it takes manually setting the
parameter value (how?)
protected ActionForward unspecified
Riyad Kalla wrote:
Does anyone know how I would be able to forward from one method in an
LDA to another method in the same LDA (or any other LDA for that
matter...)?
I do exactly this in my own apps. I use Struts forward Actions in my
struts-config. What about something like this? (I'm assu
UPDATE:
Upgraded my Struts install to nightly build and now the code snippet
below works. I'm still curious if anyone knows how one LDA can forward
to another (or the same) LDA, even if it takes manually setting the
parameter value (how?)
Thanks!
Riyad
Riyad Kalla wrote:
UPDATE:
I just tried d
UPDATE:
I just tried doing what I thought would be ugly:
protected ActionForward unspecified(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
return showList(mapping, form, request, res
Hello,
I have a situation where my LookupDispatchAction (LDA) has all my
functionality for a particular entity defined in it (lets say
"Product"). So that includes adding, removing, listing, editing and
changing their order (moving them visually up/down in the table they are
listed in).
So far
54 matches
Mail list logo