You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bert Catsburg <be...@catsburg.com> on 2003/02/17 16:44:20 UTC
Action not executed, only the *.do url is shown and the screen is
empty
Hello,
I have the problem that an Action is not executed.
When I process the Form (by clicking Submit button), the
.do url is shown in the addressbar and an empty screen
is shown.
The start of the Action javafile does some logging (using
Log4J), but I see nothing in the MySQL (to where I am logging to).
The ActionForm also does some logging to the same Log4J appender
(in the first setter) and that one is shown.
Below is the struts-config.xml file (only the Action), it's
quite standard as you see.
<!-- Process a user logon -->
<action path="/logon"
type="fimp.logon.LogonAction"
name="logonForm"
scope="request"
validate="false"
input="/logon.jsp">
<forward name="success-login" path="/index2.jsp" />
</action>
Also, the first couple of lines from the Action:
package fimp.logon;
// <<imports removed from this extract
public class LogonAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
Logger log = Logger.getLogger(LogonAction.class);
log.debug("Entered the LogonAction class");
If anybody can help me, it would be appreciated.
Thank you,
Bert Catsburg
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Action not executed, only the *.do url is shown and the screen
is empty
Posted by Bert Catsburg <be...@catsburg.com>.
More info:
The tomcat logfile shows:
2003-02-17 18:38:36 action: Processing a POST for /logon
2003-02-17 18:38:36 action: Looking for ActionForm bean under attribute
'logonForm'
2003-02-17 18:38:36 action: Creating new ActionForm instance of class
'fimp.logon.LogonForm'
2003-02-17 18:38:36 action: Storing instance under attribute
'logonForm' in scope 'request'
2003-02-17 18:38:36 action: Populating bean properties from this request
2003-02-17 18:38:36 action: Validating input form properties
2003-02-17 18:38:36 action: Looking for Action instance for class
fimp.logon.LogonAction
2003-02-17 18:38:36 action: Double checking for Action instance
already there
2003-02-17 18:38:36 action: Creating new Action instance
So, this means that the Action is created, isn't it? But why am
I not seeing the logger messages or results from Action then?
I'm am comparing line for line with other examples, like the one
from the Wiley book about Struts, but I can see no differences in
the parts that should matter.
Bert Catsburg
Bert Catsburg wrote:
> Hello,
>
> I have the problem that an Action is not executed.
> When I process the Form (by clicking Submit button), the
> .do url is shown in the addressbar and an empty screen
> is shown.
>
>
> The start of the Action javafile does some logging (using
> Log4J), but I see nothing in the MySQL (to where I am logging to).
> The ActionForm also does some logging to the same Log4J appender
> (in the first setter) and that one is shown.
>
> Below is the struts-config.xml file (only the Action), it's
> quite standard as you see.
>
> <!-- Process a user logon -->
> <action path="/logon"
> type="fimp.logon.LogonAction"
> name="logonForm"
> scope="request"
> validate="false"
> input="/logon.jsp">
> <forward name="success-login" path="/index2.jsp" />
>
> </action>
>
> Also, the first couple of lines from the Action:
>
> package fimp.logon;
>
> // <<imports removed from this extract
> public class LogonAction extends Action {
>
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
> throws IOException, ServletException {
>
> Logger log = Logger.getLogger(LogonAction.class);
> log.debug("Entered the LogonAction class");
>
>
> If anybody can help me, it would be appreciated.
>
> Thank you,
>
> Bert Catsburg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Action not executed, only the *.do url is shown and the screen
is empty
Posted by Bert Catsburg <be...@catsburg.com>.
Hello,
Found the solution.
The answer was lying around in my first posting on this subject.
Somewhere I read that the method in the Action was called
'execute'. So, I used that. But the ActionServlet start
the method 'perform' and I did not have that one. That's why
I did not get an error but the logon.do showed up and just did
nothing (empty screen)
A bit worying that no error is given when there is no 'execute'
method in Action. For newbies like me it's very confusing.
So, the new header is now:
package fimp.logon;
// <<imports removed from this extract
public class LogonAction extends Action {
public ActionForward perform(ActionMapping mapping,
Now I do get the logger info in my JDBC-appender.
Problem solved.
Bert Catsburg
Bert Catsburg wrote:
> Jim,
>
> Thanks for your answer.
> To be sure I changed the index2.jsp to main.jsp, maybe it looks too
> much like the index.jsp. (Yes, you try the less obvious at some point)
> No luck.
> To answer your question on the errors int the logfile of the container,
> I posted the other reply with more info on that. In there it looks like
> the Action is started. Only it doesn't come back on the screen.
>
> When I type in main.jsp on the address bar, I get the index.jsp,
> just as my code tells me.
> Code in main.jsp:
> <logic:notPresent name="LOGGED-IN" scope="session">
> <logic:forward name="index" />
> </logic:notPresent>
>
> Ok, normally I hate posting large portions of files, but I feel
> like I should post a larger piece of my config:
>
>
> <!-- ========== Form Bean Definitions == -->
> <form-beans>
> <form-bean name="logonForm" type="fimp.logon.LogonForm"/>
> </form-beans>
>
> <!-- ========== Global Forward Definitions = -->
> <global-forwards>
> <forward name="index" path="/index.jsp" />
> <forward name="logon" path="/logon.jsp" />
> <forward name="failure" path="/errorpage.jsp" />
> <forward name="home" path="/main.jsp" />
> </global-forwards>
>
>
> <!-- ========== Action Mapping Definitions == -->
> <action-mappings>
>
> <!-- Process a user logon -->
> <action path="/logon"
> type="fimp.logon.LogonAction"
> name="logonForm"
> scope="request"
> validate="false"
> input="/logon.jsp">
> <forward name="success-login" path="/main.jsp" />
> <forward name="index" path="/index.jsp" />
>
> </action>
>
> </action-mappings>
>
> To rephrase the quesion to a smaller one: HEEELLLLPP !!!
> :-)
>
> Thanks,
>
> Bert Catsburg
>
>
>
> Jim Theodoridis wrote:
>
>> Hi.
>>
>> Check the log files of your container to see the errors.
>>
>> Usualy this occurs because of wrong path of the JSP
>> Check the line
>>
>> <forward name="success-login" path="/index2.jsp" />
>>
>>
>> ----- Original Message -----
>> From: "Bert Catsburg" <be...@catsburg.com>
>> To: <st...@jakarta.apache.org>
>> Sent: Monday, February 17, 2003 5:44 PM
>> Subject: Action not executed, only the *.do url is shown and the
>> screen is
>> empty
>>
>>
>>
>>> Hello,
>>>
>>> I have the problem that an Action is not executed.
>>> When I process the Form (by clicking Submit button), the
>>> .do url is shown in the addressbar and an empty screen
>>> is shown.
>>>
>>>
>>> The start of the Action javafile does some logging (using
>>> Log4J), but I see nothing in the MySQL (to where I am logging to).
>>> The ActionForm also does some logging to the same Log4J appender
>>> (in the first setter) and that one is shown.
>>>
>>> Below is the struts-config.xml file (only the Action), it's
>>> quite standard as you see.
>>>
>>> <!-- Process a user logon -->
>>> <action path="/logon"
>>> type="fimp.logon.LogonAction"
>>> name="logonForm"
>>> scope="request"
>>> validate="false"
>>> input="/logon.jsp">
>>> <forward name="success-login" path="/index2.jsp" />
>>>
>>> </action>
>>>
>>> Also, the first couple of lines from the Action:
>>>
>>> package fimp.logon;
>>>
>>> // <<imports removed from this extract
>>> public class LogonAction extends Action {
>>>
>>> public ActionForward execute(ActionMapping mapping,
>>> ActionForm form,
>>> HttpServletRequest request,
>>> HttpServletResponse response)
>>> throws IOException, ServletException {
>>>
>>> Logger log = Logger.getLogger(LogonAction.class);
>>> log.debug("Entered the LogonAction class");
>>>
>>>
>>> If anybody can help me, it would be appreciated.
>>>
>>> Thank you,
>>>
>>> Bert Catsburg
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Action not executed, only the *.do url is shown and the screen
is empty
Posted by Bert Catsburg <be...@catsburg.com>.
Jim,
Thanks for your answer.
To be sure I changed the index2.jsp to main.jsp, maybe it looks too
much like the index.jsp. (Yes, you try the less obvious at some point)
No luck.
To answer your question on the errors int the logfile of the container,
I posted the other reply with more info on that. In there it looks like
the Action is started. Only it doesn't come back on the screen.
When I type in main.jsp on the address bar, I get the index.jsp,
just as my code tells me.
Code in main.jsp:
<logic:notPresent name="LOGGED-IN" scope="session">
<logic:forward name="index" />
</logic:notPresent>
Ok, normally I hate posting large portions of files, but I feel
like I should post a larger piece of my config:
<!-- ========== Form Bean Definitions == -->
<form-beans>
<form-bean name="logonForm" type="fimp.logon.LogonForm"/>
</form-beans>
<!-- ========== Global Forward Definitions = -->
<global-forwards>
<forward name="index" path="/index.jsp" />
<forward name="logon" path="/logon.jsp" />
<forward name="failure" path="/errorpage.jsp" />
<forward name="home" path="/main.jsp" />
</global-forwards>
<!-- ========== Action Mapping Definitions == -->
<action-mappings>
<!-- Process a user logon -->
<action path="/logon"
type="fimp.logon.LogonAction"
name="logonForm"
scope="request"
validate="false"
input="/logon.jsp">
<forward name="success-login" path="/main.jsp" />
<forward name="index" path="/index.jsp" />
</action>
</action-mappings>
To rephrase the quesion to a smaller one: HEEELLLLPP !!!
:-)
Thanks,
Bert Catsburg
Jim Theodoridis wrote:
> Hi.
>
> Check the log files of your container to see the errors.
>
> Usualy this occurs because of wrong path of the JSP
> Check the line
>
> <forward name="success-login" path="/index2.jsp" />
>
>
> ----- Original Message -----
> From: "Bert Catsburg" <be...@catsburg.com>
> To: <st...@jakarta.apache.org>
> Sent: Monday, February 17, 2003 5:44 PM
> Subject: Action not executed, only the *.do url is shown and the screen is
> empty
>
>
>
>>Hello,
>>
>>I have the problem that an Action is not executed.
>>When I process the Form (by clicking Submit button), the
>>.do url is shown in the addressbar and an empty screen
>>is shown.
>>
>>
>>The start of the Action javafile does some logging (using
>>Log4J), but I see nothing in the MySQL (to where I am logging to).
>>The ActionForm also does some logging to the same Log4J appender
>>(in the first setter) and that one is shown.
>>
>>Below is the struts-config.xml file (only the Action), it's
>>quite standard as you see.
>>
>> <!-- Process a user logon -->
>> <action path="/logon"
>> type="fimp.logon.LogonAction"
>> name="logonForm"
>> scope="request"
>> validate="false"
>> input="/logon.jsp">
>> <forward name="success-login" path="/index2.jsp" />
>>
>> </action>
>>
>>Also, the first couple of lines from the Action:
>>
>> package fimp.logon;
>>
>> // <<imports removed from this extract
>> public class LogonAction extends Action {
>>
>> public ActionForward execute(ActionMapping mapping,
>> ActionForm form,
>> HttpServletRequest request,
>> HttpServletResponse response)
>> throws IOException, ServletException {
>>
>> Logger log = Logger.getLogger(LogonAction.class);
>> log.debug("Entered the LogonAction class");
>>
>>
>>If anybody can help me, it would be appreciated.
>>
>>Thank you,
>>
>>Bert Catsburg
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Action not executed, only the *.do url is shown and the screen is empty
Posted by Jim Theodoridis <st...@tera.gr>.
Hi.
Check the log files of your container to see the errors.
Usualy this occurs because of wrong path of the JSP
Check the line
<forward name="success-login" path="/index2.jsp" />
----- Original Message -----
From: "Bert Catsburg" <be...@catsburg.com>
To: <st...@jakarta.apache.org>
Sent: Monday, February 17, 2003 5:44 PM
Subject: Action not executed, only the *.do url is shown and the screen is
empty
> Hello,
>
> I have the problem that an Action is not executed.
> When I process the Form (by clicking Submit button), the
> .do url is shown in the addressbar and an empty screen
> is shown.
>
>
> The start of the Action javafile does some logging (using
> Log4J), but I see nothing in the MySQL (to where I am logging to).
> The ActionForm also does some logging to the same Log4J appender
> (in the first setter) and that one is shown.
>
> Below is the struts-config.xml file (only the Action), it's
> quite standard as you see.
>
> <!-- Process a user logon -->
> <action path="/logon"
> type="fimp.logon.LogonAction"
> name="logonForm"
> scope="request"
> validate="false"
> input="/logon.jsp">
> <forward name="success-login" path="/index2.jsp" />
>
> </action>
>
> Also, the first couple of lines from the Action:
>
> package fimp.logon;
>
> // <<imports removed from this extract
> public class LogonAction extends Action {
>
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
> throws IOException, ServletException {
>
> Logger log = Logger.getLogger(LogonAction.class);
> log.debug("Entered the LogonAction class");
>
>
> If anybody can help me, it would be appreciated.
>
> Thank you,
>
> Bert Catsburg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org