aspose file tools*
The moose likes Struts and the fly likes Problem in running struts application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in running struts application" Watch "Problem in running struts application" New topic
Author

Problem in running struts application

Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
I am trying to run a application, the opening jsp for which is the HelloWorld.jsp



I tried running the jsp using the URL http://localhost:8080/struts2Tutorial/pages/HelloWorld.jsp, as my jsp is present in the location struts2Tutorial/pages/HelloWorld.jsp of tomcat's webapps directory. But I got this exception -

org.apache.jasper.JasperException: File "/struts-tags" not found

As far as I know the tlds that we use in the jsp need to be declared in the web.xml. Please guide me on how to do this for Struts2.0


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
lohith micheal
Greenhorn

Joined: Jan 07, 2008
Posts: 11
Is this your jsp page.
you have not mentioned the tlds in your jsp page.
like
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
Ramu Valivarthi
Ranch Hand

Joined: Apr 24, 2007
Posts: 37

Keep your tlds inside the WEB-INF/

<%@ taglib prefix="s" uri="/WEB-INF/struts-tags" %>
<html><head>
<title>Struts 2 Hello World Application!</title></head><body><h2><s:test property value="message" /></h2><p>Current date and time is: <b><s:text roperty value="currentTime" /></b></body></html>

In web.xml

<taglib>
<taglib-uri>/WEB-INF/struts-tags</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
I added this to the jsp -


<%@ taglib prefix="s" uri="/WEB-INF/struts-tags" %>

and this to web-xml



but still i got this org.apache.jasper.JasperException: File "/WEB-INF/struts-tags" not found

I also plase all the tlds to the WEB-INF/struts-tags directory.

Also.. the tag s roperty, is something specific to struts 2.0 Can anyone give me the link to get the tlds for struts 2.0
lohith micheal
Greenhorn

Joined: Jan 07, 2008
Posts: 11
HI,
if you have struts blank.war with you.
you can use the same tlds.
there is no problem with those tlds.
lohith micheal
Greenhorn

Joined: Jan 07, 2008
Posts: 11
i think there might be a problem in .class files.
just check the src destination folder.
i was also facing the same problem there was a problem in .class files.
hope this information might help you.
i was working on eclipse.
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
thanks michael

i got the tld file from the blank application..

but..i am facing the same problem as above.

also I am getting a console output -

Internal ERROR : WEB-INF/web.xml file not found

even if the file is precent at the correct location
lohith micheal
Greenhorn

Joined: Jan 07, 2008
Posts: 11
hi,
as for as i know even i was facing the same problem ,
there was a problem in my src i.e destination of .class files was in the wrong path.
so i was getting that type of error. i have not worked on tomcat.
you do one thing check where your .class files are there.are they inside the web-inf or outside the web-inf.
if it is outside then put the .class files inside the web-inf.
then compile it and run it.s
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
Hi Michael,

I pasted the classes as you told, But the problems persist
lohith mk
Greenhorn

Joined: Nov 30, 2007
Posts: 6
what sort of error your getting now?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in running struts application
 
Similar Threads
Struts 2 migration issue
Struts 2 - Helloworld example from Apache site
File not found error
requested resource (/tutorial/HellwWorld.action) is not available error
Struts 2 Tutorial �Hello World� Please Help!