Element type "servlet" must be followed by either attribute specifications, ">" or "/>"

Hi, I am using Tomcat 4.0.

Followed is the content I put in Web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet&#8722;name>action</servlet&#8722;name>
<servlet&#8722;class>org.apache.struts.action.ActionServlet</servlet&#8722;class>
<init&#8722;param>
<param&#8722;name>config</param&#8722;name>
<param&#8722;value>/WEB&#8722;INF/struts&#8722;config.xml</param&#8722;value>
</init&#8722;param>
<load&#8722;on&#8722;startup>1</load&#8722;on&#8722;startup>
</servlet>
<servlet&#8722;mapping>
<servlet&#8722;name>action</servlet&#8722;name>
<url&#8722;pattern>*.do</url&#8722;pattern>
</servlet&#8722;mapping>
</web-app>


When I run "startup" in the command prompt, it shows something like this:

Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
PARSE error at line 9 column 9
org.xml.sax.SAXParseException: Element type "servlet" must be followed by either
 attribute specifications, ">" or "/>".
Starting service Tomcat-Apache
Apache Tomcat/4.0.1

How to solve it?
LVL 9
william007Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

suprapto45Commented:
Hi,

Why do you have all those "&#8722;"?
Try to remove them and try again.

Thanks
David
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
suprapto45Commented:
<web-app>
<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>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>

0
avinthmCommented:
use this
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>
    <servlet>
        <servletname>action</servletname>
            <servletclass>org.apache.struts.action.ActionServlet</servletclass>
                <initparam>
                    <paramname>config</paramname>
                        <paramvalue>/WEBINF/strutsconfig.xml</paramvalue>
                </initparam>
                <loadonstartup>1</loadonstartup>
    </servlet>
    <servletmapping>
        <servletname>action</servletname>
            <urlpattern>*.do</urlpattern>
    </servletmapping>
</web-app>

your web.xml had some extra characters all over "&#8722;"
i just removed them
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

avinthmCommented:
oops.....i m late.
suprapto45 is right.
0
william007Author Commented:
Thanks:-)
0
william007Author Commented:
I am using emeditor, I type -, and it "helps" me to change to"&#8722;", What a strange behaviour.
0
suprapto45Commented:
hi,

Thanks for accepting. It would be good if you use a more *sophisticated* IDE such as Eclipse to help you.

David
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.