Solved

Using different extension than JSP

Posted on 2006-10-30
7
552 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle fusion vs MQ 2 122
ColdFusion Rereplace 3 82
JQuery tracking event. 3 79
When using Laravel when is better to use Alias and when is better to use Virtual Hosts? 6 127
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
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 learn how to dynamically set the form action using jQuery.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

830 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