Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using different extension than JSP

Posted on 2006-10-30
7
Medium Priority
?
555 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 2000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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 …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to count occurrences of each item in an array.

660 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