File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes struts1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts1" Watch "struts1" New topic
Author

struts1

kirthika iyer
Greenhorn

Joined: Aug 28, 2009
Posts: 4
when i tried to execute the simple hellow world sample in struts in eclipse its giving me a error in web xml file stating
The processing instruction must begin with the name of the target. web.xml (path where the web xml file is placed/StrutsExample1/WebContent/WEB-INF )
please help me in decoding this error . the code of that web xml is
<?
xml version="1.0" encoding="UTF-16"?>
<
web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<
display-name>StrutsExample1</display-name>
<
servlet>
<
servlet-name>action</servlet-name>
<
servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<
init-param>
<
param-name>config</param-name>
<
param-value>/WEB-INF/struts-config.xml</param-value>
</
init-param>
<
load-on-startup>2</load-on-startup>
</
servlet>
<
servlet-mapping>
<
servlet-name>action</servlet-name>
<
url-pattern>*.do</url-pattern>
</
servlet-mapping>
<
welcome-file-list>
<
welcome-file>index.jsp</welcome-file>
</
welcome-file-list>
</
web-app>


Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

kirthika iyer wrote:
<?
xml version="1.0" encoding="UTF-16"?>
<
web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<
display-name>StrutsExample1</display-name>
<
servlet>
<
servlet-name>action</servlet-name>
<
servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<
init-param>
<
param-name>config</param-name>
<
param-value>/WEB-INF/struts-config.xml</param-value>
</
init-param>
<
load-on-startup>2</load-on-startup>
</
servlet>
<
servlet-mapping>
<
servlet-name>action</servlet-name>
<
url-pattern>*.do</url-pattern>
</
servlet-mapping>
<
welcome-file-list>
<
welcome-file>index.jsp</welcome-file>
</
welcome-file-list>
</
web-app>

Are you sure this how your web.xml file looks like, then its wrongly formatted.
why there is line break after each opening tag?? I will correct first tag for you ..

And please use code tags, like I used.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Using a title of "struts1" in a forum completely dedicated to questions on Struts is worse than useless. What if everyone used such topic titles?

Please go back and change your post to add a more meaningful subject by clicking the


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts1