You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Heligon Sandra <sa...@nextream.fr> on 2002/09/03 17:01:25 UTC

Unable to open location, with jakarta-struts-1.1-b2-blank.war

	Hi,

	I used the jakarta-struts-1.1-b2-blank.war as model for my
application.
	I would like to place all the JSP file under the sub-directory 
	CATALINA_HOME/Webapps/MyApp/Web-inf/jsp in order to force people

	to pass through the RequestProcessor where I test user
authentication.
	It is the unique solution, isn't it ?
	But I don't understand very well, the disadvantage "Putting the JSPs
below WEB-INF 
	make it harder to reference style 	sheets ".

	So I modified the struts-config.xml file, and wrote

	<action path="/Welcome" 
                type="org.apache.struts.actions.ForwardAction" 
                parameter="/Web-inf/Jsp/Welcome.jsp" />

	but when I run my application I have the following error

	Unable to open location. Document not found on server.
	
	But the file Welcome.Jsp is available on
CATALINA_HOME/Webapps/MyApp/Web-inf/Jsp/Welcome.jsp.
	Is it an syntax error ?

	I used JBuilder, I can not see the Web-inf directory under the
WebApplication node I see
	all the directories under CATALINA_HOME/Webapps/MyApp except the
Web-inf directory.
	How is it possible ?

	thanks,
	

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Unable to open location, with jakarta-struts-1.1-b2-blank.war

Posted by Ted Husted <hu...@apache.org>.
You may need to refer to /WEB-INF/ rather than /Web-inf

The disadvantage is that if any of your JSPs need to reference images or 
   stylesheets, you can't just move those under WEB-INF too. They have 
to be above WEB-INF where the web server can access them.

It is a good idea to always use an action to load your JSPs. Whether it 
is also useful to place them under WEB-INF is debatable. If you always 
go through actions, the location of the JSP doesn't show up on the 
location bar, and people won't know where to access it directly.

The technique does *force* all references through actions, and its easy 
to see if all the JSPs have been moved under WEB-INF. So, it's a good 
trick in that sense, if that's the only way you can be sure all JSPs are 
being accessed through actions.

-Ted.

Heligon Sandra wrote:

> 	Hi,
> 
> 	I used the jakarta-struts-1.1-b2-blank.war as model for my
> application.
> 	I would like to place all the JSP file under the sub-directory 
> 	CATALINA_HOME/Webapps/MyApp/Web-inf/jsp in order to force people
> 
> 	to pass through the RequestProcessor where I test user
> authentication.
> 	It is the unique solution, isn't it ?
> 	But I don't understand very well, the disadvantage "Putting the JSPs
> below WEB-INF 
> 	make it harder to reference style 	sheets ".
> 
> 	So I modified the struts-config.xml file, and wrote
> 
> 	<action path="/Welcome" 
>                 type="org.apache.struts.actions.ForwardAction" 
>                 parameter="/Web-inf/Jsp/Welcome.jsp" />
> 
> 	but when I run my application I have the following error
> 
> 	Unable to open location. Document not found on server.
> 	
> 	But the file Welcome.Jsp is available on
> CATALINA_HOME/Webapps/MyApp/Web-inf/Jsp/Welcome.jsp.
> 	Is it an syntax error ?
> 
> 	I used JBuilder, I can not see the Web-inf directory under the
> WebApplication node I see
> 	all the directories under CATALINA_HOME/Webapps/MyApp except the
> Web-inf directory.
> 	How is it possible ?
> 
> 	thanks,
> 	
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


-- 
Ted Husted, Husted dot Com, Fairport NY US
-- Author, Java Web Development with Struts
-- Order it today:
-- http://husted.com/struts/book.html


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Unable to open location, with jakarta-struts-1.1-b2-blank.war

Posted by Victor CHEVALIER <vc...@avs-consulting.com>.
The files under WEB-INF are protected (unacessible via the browser).
If you want to put tou jsp under WEB-INF you must have at least one
welcome.jsp
under / or /jsp/ or ... but not /WEB-INF/...
then this jsp should call a struts action which will redirect to the
protected jsp
(an actionForward can call a jsp under WEB-INF).

This need confirmation.

-----Message d'origine-----
De : Heligon Sandra [mailto:sandra.heligon@nextream.fr]
Envoyé : mardi 3 septembre 2002 17:01
À : 'struts-user@jakarta.apache.org'
Objet : Unable to open location, with jakarta-struts-1.1-b2-blank.war



	Hi,

	I used the jakarta-struts-1.1-b2-blank.war as model for my
application.
	I would like to place all the JSP file under the sub-directory
	CATALINA_HOME/Webapps/MyApp/Web-inf/jsp in order to force people

	to pass through the RequestProcessor where I test user
authentication.
	It is the unique solution, isn't it ?
	But I don't understand very well, the disadvantage "Putting the JSPs
below WEB-INF
	make it harder to reference style 	sheets ".

	So I modified the struts-config.xml file, and wrote

	<action path="/Welcome"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/Web-inf/Jsp/Welcome.jsp" />

	but when I run my application I have the following error

	Unable to open location. Document not found on server.

	But the file Welcome.Jsp is available on
CATALINA_HOME/Webapps/MyApp/Web-inf/Jsp/Welcome.jsp.
	Is it an syntax error ?

	I used JBuilder, I can not see the Web-inf directory under the
WebApplication node I see
	all the directories under CATALINA_HOME/Webapps/MyApp except the
Web-inf directory.
	How is it possible ?

	thanks,


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>