You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by red phoenix <ro...@gmail.com> on 2007/07/12 09:39:40 UTC

import files question under Tomcat6.0.13

I tried with <c:import> to import a struts action,it raises a question,I use
Tomcat6.0.13,my directory is follows:
C:\tomcat\webapps\struts2-blank-2.0.8

when I use visit
http://localhost:8080/struts2-blank-2.0.8/a.jsp
it raise following error:
The requested resource (/struts2-blank-2.0.8/example/HelloWorld.action) is
not available

But when I use
http://localhost:8080/struts2-blank-2.0.8/example/HelloWorld.action, it can
runs well.
My a.jsp file is follows:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<c:import url="/example/HelloWorld.action"/>
</html>

 If I use absolute path,it can runs well,like follows:
<c:import url="
http://localhost:8080/struts2-blank-2.0.8/example/HelloWorld.action"/<http://localhost:8080/struts2-blank-2.0.8/example/HelloWorld.action%22/>>


Someone say before Tomcat5,it will run well,but after Tomcat5 or higher,it
will raise above error.I only want to use relative path,not absolute path,I
don't know why raise above error,and how to correct it?

Thanks

Re: import files question under Tomcat6.0.13

Posted by ��Ⱥ�� <cr...@yahoo.com.cn>.
I tried to use the same environment to get the error that you said recur. With
Tomcat 6.0.13 and jakarta-taglibs-standard-1.1.2, browsing 
http://localhost:8080/struts2-blank-2.0.8/a.jsp when using your code produces
the same output with you.

--- red phoenix <ro...@gmail.com> wrote:
> The requested resource (/struts2-blank-2.0.8/example/HelloWorld.action) is
> not available
> 

Since I'm new to struts, I'm not aquainted with *.action in the url. After
looking
around I find there is a HelloWorld.jsp in the example directory, and it would
possibly be that WEB-INF\src\java\example.xml which defines the HelloWorld
action, and the definition seems to be struts-only, which probably unknown by
taglibs. 
So I replace your code

> <c:import url="/example/HelloWorld.action"/>

with <c:import url="/example/HelloWorld.jsp"/> and things goes what I expected.
Using
the c:import tag, I can successfully import *.html *.jsp files.
There remains one question, why does struts use the *.action form to construct
a url,
maybe this question would be better posted on the struts user list, hehe.

> Someone say before Tomcat5,it will run well,but after Tomcat5 or higher,it
> will raise above error.I only want to use relative path,not absolute path,I
> don't know why raise above error,and how to correct it?

I also tried running the application in Tomcat 5.0.28, the error didn't
occured,
since the application can't even be successfully deployed, don't know what is
the
cause.


      ____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org