Solved

Using different extension than JSP

Posted on 2006-10-30
7
550 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xml xsd validation free tool to download 10 76
What is the normal amount of queries 5 74
Using Tomcat as raspberry pi java app server 13 134
How to analyze web traffic logs 10 100
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

929 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

12 Experts available now in Live!

Get 1:1 Help Now