File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes workflow problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "workflow problem" Watch "workflow problem" New topic
Author

workflow problem

Manuel Oetzi
Greenhorn

Joined: Jun 23, 2011
Posts: 10
Hello!

I have a curious problem concerning the workflow of my page.

First of all the relevant snippets:

struts.xml:


index.jsp:


I guess that should be already enough.

The problem is the following:
If I call the start page (index.jsp) the first time using the URL http://localhost:8080/OEZ/ I see two conspicuous things.
1. the image oez_head_900_text.png is visible (as it should :-) )
2. Checking the html source code the form tag looks like this: <form id="do_login" method="post" action="do_login" name="do_login">

If I click now on the login button no Action is involved but I am redirected to http://localhost:8080/OEZ/flow/start.action. So the login procedure does not take place as expected.
Now the 2 conspicuous things look like this:
1. the image is not displayed anymore (don't know if this fact is relevant for the actual problem?!)
2. the form tag looks like this now: <form id="do_login" method="post" action="/OEZ/flow/do_login.action" name="do_login">

If I click now on the login button the login procedure works as expected.

So my main question is:
Why does the login not work when clicking the login button the first time?
I guess that is has something to do with my package definition within the struts.xml, but I don't see what is wrong here.
Anyway, I am wondering why I not immediatly redirected to .../flow/start.action when I call the page for the first time. Shouldn't the default-package definition do this for every request not specifiying a concrete namespace?

Any struts pro how can help me? :-)

Greetings,
oetzi


Jesus Mireles
Ranch Hand

Joined: Mar 10, 2010
Posts: 122

First of all the reason your image isnt showing is because of the way you built the src tag for the image. You should think about using <s:url to build it. So instead of what you did you should do:



Have you tried defining your namespace in the form? Its only going to redirect on a SUCCESS response from your execute method but that may perhaps be your issue ...

So ...

Manuel Oetzi
Greenhorn

Joined: Jun 23, 2011
Posts: 10
Hey Jesus,

thanks for your answer.
The issue with the image has been solved, but unfortunately not the one with the workflow.

Jesus Mireles wrote:
Have you tried defining your namespace in the form? Its only going to redirect on a SUCCESS response from your execute method but that may perhaps be your issue ...


The login action itself is not called at all. My debug print.out is first displayed after clicking the second time on the login-button.
Therefore I assume that it has something to do with the workflow defined in the struts.xml.

By the way the following warning is displayed when calling the start page, but also for the "second start page".
24.06.2011 10:18:55 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARN: No configuration found for the specified action: 'do_login' in namespace: 'flow'. Form action defaulting to 'action' attribute's literal value.
-> I don't see the reason for this warning as I have the name space "flow" and the action "do_login in it.


Jesus Mireles
Ranch Hand

Joined: Mar 10, 2010
Posts: 122

Actually your namespace is defined as /flow in the struts ... so thats what you should use for namespace instead of just flow without the /

-Jesus
Manuel Oetzi
Greenhorn

Joined: Jun 23, 2011
Posts: 10
oh my god...
Sometimes also the little things can have a hugh impact... ;-)

Thanks a lot!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: workflow problem
 
Similar Threads
Help: Getting Error Message "Not able to load configuration for specified action"
Problems deploying struts 2 app on weblogic 10gR3
problems in validation part of struts 2
problems validation.xml in struts 2
"No configuration found for the specified action" error in struts2