wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts extension with welcome file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts extension with welcome file" Watch "Struts extension with welcome file" New topic
Author

Struts extension with welcome file

Jorge Sereno
Greenhorn

Joined: Jun 30, 2012
Posts: 9
Hello. I have simple hello world application named "helloexample" where me index.hml, wish is my welcome file defined in web.xml, as the code:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh"
content="0;URL='startPage'">
</head>
</html>
where startPage is an action on struts.xml.
so i just type in browser localhost:8080\helloexample and the aplication starts running the startpage action.

With the “struts.action.extension” set to “html” in my struts.xml it does not work, whithout works fine. I can’t find the problem.
Anyone can help me?

Thankx
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

try the following by adding .html extension localhost:8080\helloexample\startPage.html



When you were not overriding the default extension it will add automatically. But when you were overriding it you should explicitly specify it.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Jorge Sereno
Greenhorn

Joined: Jun 30, 2012
Posts: 9
Hi thankx for your comment. but helloexample is just the application name, you can´t add extension. when i type "localhost:8080\helloexample" it must read the welcome file and then de refreshed action page wish is "startPage" action.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

@Jorge I was corrected my answer check it once.
Jorge Sereno
Greenhorn

Joined: Jun 30, 2012
Posts: 9
Hi Mohana thankx for the reply. Now it make more sence, and i know that code works.
The problem is when you type "localhost:8080\helloexample\startPage.html" like you said
you are not calling the welcome file, you are calling the action. To call the welcome file
you must type "localhost:8080\helloexample" and this is the problem, it gaves me the error:



I already have the welcome file like you said.
without "struts.action.extension" it works just fine when i type "localhost:8080\helloexample"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts extension with welcome file