• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 welcome-file-list

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have already view other posts in this forum related with this subject but neither of the solutions presented have worked.

In my struts.xml I declare a generic action without a class mapped like:

<action name="LogForm">
<result>Login.jsp<result/>
<action/>

I have removed my welcome-file-list from my web.xml file. But when I try to run and deploy the application in WebLogic I get the error:
No action mapped for action .

How can I start my application with an action and not with a jsp file, since I need to apply an interceptor to control sessions.
I have already tried to redirect from the jsp file to an action with <s: action=""> but I don't like this solution.

Thanks in advance.



 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ainar Martin ,

How you call your action from your browser. For example you try like this,
http://localhost:8080/example/LogForm.action


 
Ainar Martin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, thanks for your reply.

If I try to access an action directly I get a page not found error for example:

http://localhost:8080/MyProject/login.action

where login.action is an action that I have declared in my struts.xml file

Though if I access my login.jsp page and submit, then the action gets executed.
I would like to execute the action first to apply an interceptor that controls the user sessions.

Thank you.
 
devi sam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

What is your requirement? you want to access a jsp page from struts action throw struts.xml means try like this in your xml mapping,
<struts>

<action name="loginAction">
<result name="success">/login.jsp</result>
</action>

<action name="loginAction" class="LoginAction">
<result name="success">/login.jsp</result>
</action>
</struts>

The first empty action will call your login.jsp.The second loginAction will mapped to the LoginAction class, if the execute method will return success means it will display login.jsp.

Thank you....







reply
    Bookmark Topic Watch Topic
  • New Topic