Solved

Using different extension than JSP

Posted on 2006-10-30
7
549 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now