Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts1

 
kirthika iyer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic