Solved

Using different extension than JSP

Posted on 2006-10-30
7
554 Views
Last Modified: 2013-11-19
Hello!

I saw some JSP sites uses .do extension for their files...

I want to ask how can I use .xxx files instead of .jsp files? I want to define this for NetScape Enterprise Server 6.1 (in windows and solaris - both)

How this is possible?

Thanks from now!
0
Comment
Question by:CSecurity
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17832751
you can to specify that in your web.xml under <url-pattern> tag

here is an example

  <servlet>
    <servlet-name>admin</servlet-name>
    <jsp-file>/jsp/admin/admin.jsp</jsp-file>
  </servlet>
  <servlet-mapping>
    <servlet-name>admin</servlet-name>
    <url-pattern>/admin.do</url-pattern>
  </servlet-mapping>

 

0
 
LVL 17

Author Comment

by:CSecurity
ID: 17832924
Thanks alot for your answer! It produces a 500 Internal server error!
Can you paste here a complete web-xml file?

Where I should put that and why 500 internal error? (I think it should be in /WEB-INF/web.xml)
0
 
LVL 10

Accepted Solution

by:
mbvvsatish earned 500 total points
ID: 17832953
>I think it should be in /WEB-INF/web.xml
yeah thats right.
you need to redeploy your web application once you change the web.xml file

here is the sample web.xml file

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>Example</display-name>
  <servlet>
    <servlet-name>admin</servlet-name>
    <jsp-file>/jsp/admin/admin.jsp</jsp-file>
  </servlet>
  <servlet-mapping>
    <servlet-name>admin</servlet-name>
    <url-pattern>/admin.do</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>sample</servlet-name>
    <jsp-file>/jsp/sample/sample.jsp</jsp-file>
  </servlet>
  <servlet-mapping>
    <servlet-name>sample</servlet-name>
    <url-pattern>/sample.do</url-pattern>
  </servlet-mapping>

</web-app>

0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
LVL 17

Author Comment

by:CSecurity
ID: 17832964
Again I got 500 error and this is what I have in log file:





30/Oct/2006:15:50:00] failure (  680): ContextConfig[] WEB3521: Configuration error in application web.xml
java.lang.IllegalArgumentException: WEB2715: JSP file index.jsp must start with a /
      at org.apache.catalina.core.StandardContext.addChild(StandardContext.java:1473)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.apache.catalina.util.xml.AddChild.end(XmlMapper.java:811)
      at org.apache.catalina.util.xml.XmlMapper.matchEnd(XmlMapper.java:419)
      at org.apache.catalina.util.xml.XmlMapper.endElement(XmlMapper.java:119)
      at org.xml.sax.helpers.XMLReaderAdapter.endElement(XMLReaderAdapter.java:353)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1720)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
      at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
      at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
      at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
      at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:314)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:89)
      at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
      at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:312)
      at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1005)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:257)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3752)
      at com.iplanet.ias.web.WebModule.start(WebModule.java:257)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
      at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
      at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
      at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
      at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)

[30/Oct/2006:15:50:00] failure (  680): ContextConfig[]: WEB3541: Marking this application unavailable due to previous error(s)
[30/Oct/2006:15:50:00] failure (  680): WebModule[]: WEB2705: Context startup failed due to previous errors
[30/Oct/2006:15:50:00] failure (  680): WebModule[]: WEB2720: Error initializing naming context for context
javax.naming.NamingException: WEB3880: Unknown context name : StandardEngine[null].StandardHost[https-securecode].StandardContext[]
      at org.apache.naming.ContextBindings.bindThread(ContextBindings.java:207)
      at org.apache.catalina.core.StandardContext.bindThread(StandardContext.java:4173)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3861)
      at com.iplanet.ias.web.WebModule.stop(WebModule.java:342)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3832)
      at com.iplanet.ias.web.WebModule.start(WebModule.java:257)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
      at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
      at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
      at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
      at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
0
 
LVL 17

Author Comment

by:CSecurity
ID: 17832965
And this is what I have in web.xml:




<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>Example</display-name>
  <servlet>
    <servlet-name>admin</servlet-name>
    <jsp-file>index.jsp</jsp-file>
  </servlet>
  <servlet-mapping>
    <servlet-name>admin</servlet-name>
    <url-pattern>/index.nc</url-pattern>
  </servlet-mapping>

</web-app>
0
 
LVL 17

Author Comment

by:CSecurity
ID: 17832974
Sorry! It worked well!

Thanks alot
0
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17832981
> <jsp-file>index.jsp</jsp-file>
in your web.xml the above should be changed like this

<jsp-file>/index.jsp</jsp-file>
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question