Mapping JSP files
Hi, I am using Tomcat 4.0.3. I am trying to map my JSP pages by giving the following code in web.xml file.
<servlet>
<servlet-name>AJSP</servlet-name>
<jsp-file>/myjsp.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>AJSP</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
But I am getting the following error when I try to start tomcat. If I remove above lines, then there is no problem.
org.xml.sax.SAXParseException: The content of element type "web-app" must match
"(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-
mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welco
me-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-const
raint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
Thank in advance
Ravi
Why would you map a jsp?
you can just add jsp files to your directories and they will be compiled at the first load...
when you update files they will be loaded also...
I can't imagine any advantage on mapping jsp files...
greetings
Similar Messages
-
Re: mapping of a directory containing JSP files
Thanks for the quick response..
but i want some other root directory other than the DefaultWebApp where i
can put my jsp files...either under DefaultWebApp or preferably some where
else....
Is that possible ?
Pankaj
"Deepak Vohra" <[email protected]> wrote in message
news:[email protected]...
> JSPs do not require specific mappings as do HTTP servlets.
> Place your Jsps, for example configureJsp.jsp, in the
DefaultWebApp/presentation
> directory.
>
> In a web browser, request the JSP file using the following URL:
> http://localhost:7001/presentation/configureJsp.jsp
>
> Pankaj Bansal wrote:
>
> > Hi,
> > Iam using weblogic 6.1, SP2.
> >
> > I have created a web application with the DefaultWebApp directory
where
> > u can put ur jsp files for them to be available automatically..
> >
> > Can someone tell me is there a way to map jsp files to some other
directory
> > ?
> > Or can i make some subdirectory under DefaultWebApp like 'presentation'
and
> > keep my jsp files in that and not be required to write the directory
name
> > ( presentation) for accessing my files.
> >
> > In short is it possible in some way to map some directory where i put my
jsp
> > files and they are readily accessible, other than the DefaultWebApp
> > directory.
> >
> > thanks,
> > --
> >
> > Pankaj
>
how to To install a jsp under another Web Application in wls 7.0.1? and i just
don't want to deploy jar,ear,war... file.
It seems there are many differences between wls7 and wls7.0.1.
Deepak Vohra <[email protected]> wrote:
>Pankaj
>
>DefaultWebApp is the default Web application. To install a jsp under
>another Web
>
> Application,create a new Web Application, for example ConfigJspWebApp.
>Install
>the
>new Web Application. Place Jsp, for example configJsp.jsp in the
> ConfigJspWebApp/presentation directory.
>
>
>In a web browser, request the JSP file using the following URL:
>http://localhost:7001/ConfigJspWebApp/presentation/configJsp.jsp
>
>
>Pankaj Bansal wrote:
>
>> Thanks for the quick response..
>> but i want some other root directory other than the DefaultWebApp where
>i
>> can put my jsp files...either under DefaultWebApp or preferably some
>where
>> else....
>> Is that possible ?
>>
>> --
>>
>> Pankaj
>>
>> "Deepak Vohra" <[email protected]> wrote in message
>> news:[email protected]...
>> > JSPs do not require specific mappings as do HTTP servlets.
>> > Place your Jsps, for example configureJsp.jsp, in the
>> DefaultWebApp/presentation
>> > directory.
>> >
>> > In a web browser, request the JSP file using the following URL:
>> > http://localhost:7001/presentation/configureJsp.jsp
>> >
>> > Pankaj Bansal wrote:
>> >
>> > > Hi,
>> > > Iam using weblogic 6.1, SP2.
>> > >
>> > > I have created a web application with the DefaultWebApp directory
>> where
>> > > u can put ur jsp files for them to be available automatically..
>> > >
>> > > Can someone tell me is there a way to map jsp files to some other
>> directory
>> > > ?
>> > > Or can i make some subdirectory under DefaultWebApp like 'presentation'
>> and
>> > > keep my jsp files in that and not be required to write the directory
>> name
>> > > ( presentation) for accessing my files.
>> > >
>> > > In short is it possible in some way to map some directory where
>i put my
>> jsp
>> > > files and they are readily accessible, other than the DefaultWebApp
>> > > directory.
>> > >
>> > > thanks,
>> > > --
>> > >
>> > > Pankaj
>> >
>
-
Mapping of a directory containing JSP files
Hi,
Iam using weblogic 6.1, SP2.
I have created a web application with the DefaultWebApp directory where
u can put ur jsp files for them to be available automatically..
Can someone tell me is there a way to map jsp files to some other directory
Or can i make some subdirectory under DefaultWebApp like 'presentation' and
keep my jsp files in that and not be required to write the directory name
( presentation) for accessing my files.
In short is it possible in some way to map some directory where i put my jsp
files and they are readily accessible, other than the DefaultWebApp
directory.
thanks,
Pankaj
JSPs do not require specific mappings as do HTTP servlets.
Place your Jsps, for example configureJsp.jsp, in the DefaultWebApp/presentation
directory.
In a web browser, request the JSP file using the following URL:
http://localhost:7001/presentation/configureJsp.jsp
Pankaj Bansal wrote:
> Hi,
> Iam using weblogic 6.1, SP2.
>
> I have created a web application with the DefaultWebApp directory where
> u can put ur jsp files for them to be available automatically..
>
> Can someone tell me is there a way to map jsp files to some other directory
> ?
> Or can i make some subdirectory under DefaultWebApp like 'presentation' and
> keep my jsp files in that and not be required to write the directory name
> ( presentation) for accessing my files.
>
> In short is it possible in some way to map some directory where i put my jsp
> files and they are readily accessible, other than the DefaultWebApp
> directory.
>
> thanks,
> --
>
> Pankaj
-
Mapping new file extension as JSP file in 6.1sp1
How can I map .coolJsp as a JSP file in WLS6.1sp1? This seems to work,
but is really ugly:
web.xml:
<servlet>
<servlet-name>JSPServlet</servlet-name>
<servlet-class>weblogic.servlet.JSPServlet</servlet-class>
<init-param>
<param-name>compileCommand</param-name>
<param-value>/bea/jdk131/bin/javac.exe</param-value>
</init-param>
<init-param>
<param-name>workingDir</param-name>
<param-value>.foo</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>JSPServlet</servlet-name>
<url-pattern>*.coolJsp</url-pattern>
</servlet-mapping>
If you think that's ugly, you should see this one app where a guy mapped
".coolJsp" extension as if it were a ".jsp" ;-)
Just kidding, but I am really curious what you are trying to do? Maybe there
is an easier way? Are you just trying to use a different extension, because
you could always map coolJsp to a router servlet that fw to the appropriate
.jsp.
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"Tommi Reiman" <tommi_not_spam@nO_spam.soon.fi> wrote in message
news:[email protected]..
> How can I map .coolJsp as a JSP file in WLS6.1sp1? This seems to work,
> but is really ugly:
>
> web.xml:
> ########
>
> <servlet>
> <servlet-name>JSPServlet</servlet-name>
> <servlet-class>weblogic.servlet.JSPServlet</servlet-class>
> <init-param>
> <param-name>compileCommand</param-name>
> <param-value>/bea/jdk131/bin/javac.exe</param-value>
> </init-param>
> <init-param>
> <param-name>workingDir</param-name>
> <param-value>.foo</param-value>
> </init-param>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>JSPServlet</servlet-name>
> <url-pattern>*.coolJsp</url-pattern>
> </servlet-mapping>
>
>
-
I have a jsp file with extension *.abc. The browser is showing the files as text instead of sending it to be processed as a jsp file.
I have the following settings in the web.xml but it is not picking it up.
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url-pattern>
*.abc
</url-pattern>
</servlet-mapping>
This is kind of a hack and not officially supported, but you might try...
<servlet>
<servlet-name>ABC</servlet-name>
<servlet-class>weblogic.servlet.JSPServlet</servlet-class>
<init-param>
<param-name>compileCommand</param-name>
<param-value>javac</param-value>
</init-param>
<init-param>
<param-name>workingDir</param-name>
<param-value>WEB-INF/classes</param-value>
</init-param>
</servlet>
Since this isn't the default JSPServlet registration, it doesn't pick up the
default JSPServlet init arguments, so after some experimentation I figured
out that you have to at least define these two. Others that you may want to
configure are...
defaultFileName
compileCommand
compilerClass
compileFlags
workingDir
verbose
keepgenerated
precompileContinue
pageCheckSeconds
encoding
packagePrefix
superclass
noTryBlocks
compilerSupportsEncoding
These are all defined as jsp-descriptor args in the weblogic.xml file, but
you can equally use them as servlet-args for your custom JSP registration
Good luck,
Alex
P.S.
Why don't you want to use jsp files anyway?
"shelley otero" <[email protected]> wrote in message
news:[email protected]...
> I have a jsp file with extension *.abc. The browser is showing the files
as text instead of sending it to be processed as a jsp file.
>
> I have the following settings in the web.xml but it is not picking it up.
>
> <servlet-mapping>
> <servlet-name>
> jsp
> </servlet-name>
> <url-pattern>
> *.abc
> </url-pattern>
> </servlet-mapping>
>
-
Java.io.IOException: unable to find the type mapping resource file
Hi,
I am using weblogic7.0 to deploy my applications. I wrote a web service and
was able to deploy it sucessfully. I am trying to access the web service through
a jsp page. I am the error posted below on my server and " error:505 internal
server error" on the browser. Can any one please help me out with the problem.
My jsp page just displays the float value i am returing from the session bean
method.
Thanks,
Ramya.
<Apr 14, 2003 4:32:51 PM PDT> <Error> <HTTP> <101019> <[ServletContext(id=64204
55,name=bankwebapp,context-path=/bankwebapp)] Servlet failed with IOException
java.io.IOException: unable to find the type mapping resource file for:bank.Ban
kService
at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
stry.java:62)
at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
at bank.BankService_Impl.<init>(BankService_Impl.java:23)
at jsp_servlet.__getbal._jspService(__getbal.java:106)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
n(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:445)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
on.run(WebAppServletContext.java:5412)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
ceManager.java:744)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
ervletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
mpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
>
<Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149400> <Activatin
g application: appsdirbankwebapp_war>
<Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149404> <Activate
application appsdirbankwebapp_war on myserver - Running>
<Apr 14, 2003 4:41:01 PM PDT> <Notice> <Application Poller> <149404> <Activate
application appsdirbankwebapp_war on myserver - Completed>
The url value from the jsp page ishttp://localhost:7001
The wsdl value from the jsp page ishttp://localhost:7001/web_services/BankServi
ce
<Apr 14, 2003 4:41:06 PM PDT> <Error> <HTTP> <101019> <[ServletContext(id=72463
20,name=bankwebapp,context-path=/bankwebapp)] Servlet failed with IOException
java.io.IOException: unable to find the type mapping resource file for:bank.Ban
kService
at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
stry.java:62)
at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
at bank.BankService_Impl.<init>(BankService_Impl.java:23)
at jsp_servlet.__getbal._jspService(__getbal.java:106)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
n(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:445)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
on.run(WebAppServletContext.java:5412)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
ceManager.java:744)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
ervletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
mpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
>Hi Manoj,
Thanks a lot for your hepl. I tried as you said and its working now.
Ramya
"manoj cheenath" <[email protected]> wrote:
Make sure that you put the client jar file generated by
clientgen in the lib directory of the jsp web app.
It looks like the runtime is unable to load
<service>.xml type mapping file. This xml file
should be in the classpath (web-inf/lib or
web-inf/classes).
-manoj
"Ramya" <[email protected]> wrote in message
news:[email protected]...
Hi,
I am using weblogic7.0 to deploy my applications. I wrote a web serviceand
was able to deploy it sucessfully. I am trying to access the web servicethrough
a jsp page. I am the error posted below on my server and " error:505internal
server error" on the browser. Can any one please help me out with theproblem.
My jsp page just displays the float value i am returing from the sessionbean
method.
Thanks,
Ramya.
<Apr 14, 2003 4:32:51 PM PDT> <Error> <HTTP> <101019><[ServletContext(id=64204
55,name=bankwebapp,context-path=/bankwebapp)] Servlet failed withIOException
java.io.IOException: unable to find the type mapping resource filefor:bank.Ban
kService
atweblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
stry.java:62)
atweblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
at bank.BankService_Impl.<init>(BankService_Impl.java:23)
at jsp_servlet.__getbal._jspService(__getbal.java:106)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
n(ServletStubImpl.java:1058)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:401)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:445)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:306)
atweblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
on.run(WebAppServletContext.java:5412)
atweblogic.security.service.SecurityServiceManager.runAs(SecurityServi
ceManager.java:744)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
ervletContext.java:3086)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
mpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
>
<Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149400><Activatin
g application: appsdirbankwebapp_war>
<Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149404><Activate
application appsdirbankwebapp_war on myserver - Running>
<Apr 14, 2003 4:41:01 PM PDT> <Notice> <Application Poller> <149404><Activate
application appsdirbankwebapp_war on myserver - Completed>
The url value from the jsp page ishttp://localhost:7001
The wsdl value from the jsp page
ishttp://localhost:7001/web_services/BankServi
ce
<Apr 14, 2003 4:41:06 PM PDT> <Error> <HTTP> <101019><[ServletContext(id=72463
20,name=bankwebapp,context-path=/bankwebapp)] Servlet failed withIOException
java.io.IOException: unable to find the type mapping resource filefor:bank.Ban
kService
atweblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
stry.java:62)
atweblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
at bank.BankService_Impl.<init>(BankService_Impl.java:23)
at jsp_servlet.__getbal._jspService(__getbal.java:106)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
n(ServletStubImpl.java:1058)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:401)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:445)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
mpl.java:306)
atweblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
on.run(WebAppServletContext.java:5412)
atweblogic.security.service.SecurityServiceManager.runAs(SecurityServi
ceManager.java:744)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
ervletContext.java:3086)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
mpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
> -
Use of jsp-file in web.xml
hello
can anybody explain about , when we need <jsp-file> in web.xml
and why we use this tag in place of <url-pattern>?If you want to declare a JSP in your web.xml file you use the jsp-file tag instead of the servlet-class tag. Normally there is no need to declare a JSP in the web.xml file unless you want to use init-params.
Usually people can access a JSP directly wether it is declared in the web.xml or not. So it is not that the jsp-file tag replaces the url-pattern tag so much as the url-pattern tag is not needed for a JSP. However notthing prevents you from declaring the JSP in the web.xml and then mapping the JSP to a different url that doesn't end in '.jsp'. -
Jsp-file="/WEB-INF/index.jsp" cannot load
Hi,
I am defining a servlet in the web.xml file using the following syntax.
<servlet>
<servlet-name>TestServlet</servlet-name>
<jsp-file>/WEB-INF/index.jsp</jsp-file>
</servlet>
Then when I tried to access this servlet, I get a 404 not found error. The weblogic.log
file complains with the following message:
java.io.FileNotFoundException: no resource '/WEB-INF/index.jsp' in servlet context
root '/home/dev/web/apps/MyApp'
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:293)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
My jsp file in located in /home/dev/web/apps/MyApp/WEB-INF/index.jsp, I know weblogic
doesn't support jsp under WEB-INF, however, according to Sun's Servlet specification,
anything under web-inf should be accessible to getResource and getResourceAsStream
method, and it looks like that's what weblogic implementation is using (from the
error message). So I am not sure whether this is weblogic issue or I am doing
something wrong. By the way, the above config in web.xml is supported in Tomcat.
What version of WebLogic will incorporate Servlet spec 2.4 and allow jsp under
web-inf?
Chris
"Narayan Anand" <[email protected]> wrote:
>Regarding S-12864 - It will not work as stated in the solution in any
>of
>the available releases of WLS.
>Please ignore that. I already informed the concerned person to correct
>the
>solution.
>
>The story behind this is:
>Our engineering team is already aware of the fact that the request
>dispatcher calls (include/forward) for a jsp under the web-inf directory
>works in other app server - Tomcat.
>Our engineering team had a discussion with the servlet/jsp spec experts
>group for clarifying the spec and the tomcat implementation.
>So the servlet expert group has decided to explicitly state in the spec
>that
>RD.forward() and RD.include() should be allowed access to resources in
>/WEB-INF and it will be included in servlet spec 2.4. For now, WLS works
>as
>per the current specification.
>
>So far the story is - WLS will implement this in our next major release
>which will be compliance with servlet spec 2.4.
>In all the currently available WLS releases, accessed to a jsp under
>the
>WEB-INF directory is prohibited.
>
>--
>Best Regards,
>Narayan Anand
>Developer Relations Engineer
>BEA Systems, Inc.
>
>
>
>
>
>
>"Ming Fan" <[email protected]> wrote in message
>news:[email protected]...
>>
>> Thanks for the explanation. So this means weblogic treats such mapped
>servlet request
>> as a direct request to the jsp under WEB-INF, instead of forwarding
>it to
>some
>> JspCompiler servlet and let that compiler servlet use some resource
>loader
>to
>> load the jsp and then compile. I believe that latter implementation
>approach also
>> conforms the Servlet spec (it's a different way of treating the request,
>I
>guess).
>>
>> Now here's another question. According to Web logic Customer Support
>Solution
>> ID S-12864 (WLS 6.x - Cannot access JSP under the WEB-INF directory),
>the
>servlet
>> should be able to get a request dispatcher, and then forward the request
>to the
>> jsp under WEB-INF. I am still using WLS 5.1, so does the above solution
>apply
>> to 5.1 also? It doesn't seem to work with 5.1. So is this a 5.1 problem
>and I
>> should upgrade to 6.1?
>>
>> Thanks.
>>
>> "Narayan Anand" <[email protected]> wrote:
>> >Hi Ming,
>> >
>> >It is legal to put files under WEB-INF directory. But as mentioned
>in
>> >the
>> >spec, it will be available only to servlet code and not directly to
>client
>> >request.
>> >Read the last statement of the same paragraph in section9.5.
>> >"Since requests are matched to resource mappings case-sensitively,
>client
>> >requests for '/WEB-INF/foo', '/WEb-iNf/foo', for example, should not
>> >result
>> >in contents of the web application located under /WEB-INF being returned,
>> >nor any form of directory listing thereof.".
>> >
>> >So in your case, when you access the servlet which gets mapped to
>> >/WEB-INF/your-jspfile, under no condition it should result in display
>> >of jsp
>> >contents.
>> >It is working as per the specification.
>> >
>> >I hope this helps.
>> >
>> >Regards,
>> >Narayan Anand
>> >Developer Relations Engineer
>> >BEA WebLogic Support
>> >
>> >
>> >
>> >"Ming Fan" <[email protected]> wrote in message
>> >news:[email protected]...
>> >>
>> >> Actaully there are other ways to solve my problem. But what I am
>> >interested to
>> >> know is under the Servlet specification 2.3, is it legal to put
>jsp
>> >under
>> >WEB-INF,
>> >> define it in <jsp-file> xml tag, and should the JSP compiler be
>able
>> >to
>> >see this
>> >> as a resource. Apparently, Tomcat allows this behavior, so does
>this
>> >mean
>> >Tomcat
>> >> conforms better to the Servlet spec, or Tomcat is wrong but Weblogic
>> >conforms
>> >> better? Can anyone let me know what's the correct interpretation
>of
>> >section 9.5
>> >> in servlet spec 2.3?
>> >>
>> >>
>> >> "Jerrie Pineda" <[email protected]> wrote:
>> >> >Try moving it to a different dir. You normally don't place jsp
>file
>> >> >in the
>> >> >WEB-INF dir.
>> >> >
>> >> >
>> >> >"Ming Fan" <[email protected]> wrote in message
>> >> >news:[email protected]...
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> I am defining a servlet in the web.xml file using the following
>> >syntax.
>> >> >> <servlet>
>> >> >> <servlet-name>TestServlet</servlet-name>
>> >> >> <jsp-file>/WEB-INF/index.jsp</jsp-file>
>> >> >> </servlet>
>> >> >>
>> >> >> Then when I tried to access this servlet, I get a 404 not found
>> >error.
>> >> >The
>> >> >weblogic.log
>> >> >> file complains with the following message:
>> >> >> java.io.FileNotFoundException: no resource '/WEB-INF/index.jsp'
>> >in
>> >> >servlet
>> >> >context
>> >> >> root '/home/dev/web/apps/MyApp'
>> >> >> at
>weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:293)
>> >> >> at
>> >weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
>> >> >> at
>> >>
>>
>>>weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:
>2
>> >0
>> >> >0)
>> >> >> at
>> >>
>>
>>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.ja
>v
>> >a
>> >> >:115)
>> >> >> at
>> >>
>>
>>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextI
>m
>> >p
>> >> >l.java:922)
>> >> >> at
>> >>
>>
>>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextI
>m
>> >p
>> >> >l.java:886)
>> >> >> at
>> >>
>>
>>>weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletConte
>x
>> >t
>> >> >Manager.java:269)
>> >> >> at
>> >>
>>
>>>weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380
>)
>> >> >> at
>> >> >weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
>> >> >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
>> >> >>
>> >> >> My jsp file in located in
>/home/dev/web/apps/MyApp/WEB-INF/index.jsp,
>> >> >I
>> >> >know weblogic
>> >> >> doesn't support jsp under WEB-INF, however, according to Sun's
>Servlet
>> >> >specification,
>> >> >> anything under web-inf should be accessible to getResource and
>> >> >getResourceAsStream
>> >> >> method, and it looks like that's what weblogic implementation
>is
>> >using
>> >> >(from the
>> >> >> error message). So I am not sure whether this is weblogic issue
>> >or
>> >> >I am
>> >> >doing
>> >> >> something wrong. By the way, the above config in web.xml is
>supported
>> >> >in
>> >> >Tomcat.
>> >> >
>> >> >
>> >>
>> >
>> >
>>
>
>
-
How to map jsp in web.xml
Hi,
CAn anybody tell me that how to map .jsp in web.xml
thanx
vjoySame as servlets, except that you specify jsp-file in place of servlet-class - see below
<servlet>
<servlet-name>MyJspServlet</servlet-name>
<jsp-file>/jspServlet.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>MyJspServlet</servlet-name>
<url-pattern>/myJspServlet</url-pattern>
</servlet-mapping>cheers,
ram. -
Problem in executing a JSP file that includes a Custm tag
Hi,
I am very new to JSP,especially custom tags. I tried to run my first custom tag program but i cud not succeed.
I tried to run it using Tomcat as well J2ee1.3. But still cud not c the output.
I have placed jsp file,TLD etc in Web inf of root dir and class file inside classes folder..but i got some error saying tag with prefix not found in the tag library...
i tried in all the ways but all in vain... I will post my code and exact error i faced.. can anyone help me soon to see the output?
WelcomCtag.java
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class WelcomeCtag extends TagSupport
private String Name=null;
public String getName()
return Name;
public int doStartTag()
try
JspWriter output=pageContext.getOut();
output.println("Welcome" + getName());
}catch(Exception e)
throw new Error("Encountered an errer");
return SKIP_BODY;
public int doEndTag()
try{}
catch(Exception e)
throw new Error("Encountered an errer");
finally
return SKIP_PAGE;
[u]example.tld[/u]
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>example</shortname>
<info> A small example for usage of the tag library</info>
<tag>
<name> Welcome></name>
<tagclass>WelcomeCtag</tagclass>
<bodycontent>empty</bodycontent>
<info>This tag is an example to display a welcome message</info>
<attribute>
<name>Name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
[u]WelcomeCustomtag.jsp[/u]
<%@ taglib prefix="example" uri="./example.tld" %>
<html>
<title>Welcome Handler</title>
</head>
<body>
<example: Welcome Name="Panduranga"/>
</body>
</html>
and the error i get while executing is here..........
org.apache.jasper.JasperException: /WelcomeCustomtag.jsp(6,0) No tag "" defined in tag library imported with prefix "example"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:196)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1308)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1564)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
when i referred some other tutorials some have stored the tld file inside a folder called tags inside web inf and they have used like this <tags:example> etc and it wrked but if i want to specify some attributes i dunno how to give using <tags> style....
Can anyone help me n tell me the difference in using tag like this <eample> and <tags: example> like this.....
Thanks,
Akshatha1.
Multiple tlds in web.xml
Have multiple taglib elements in your web.xml - see below.
<jsp-config>
<taglib>
<taglib-uri>http://example/taglib</taglib-uri>
<taglib-location>/WEB-INF/example.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://anotherexample/taglib</taglib-uri>
<taglib-location>/WEB-INF/anotherexample.tld</taglib-location>
</taglib>
</jsp-config>The jsp-config element should be just after the servlet-mapping element in servlet 2.3 spec.
For 2.4 spec, you can put it anywhere.
In your jsp, to use the tags from the two tag libraries, use 2 taglib directives
<%@ taglib prefix="example" uri="http://example/taglib" %>
<%@ taglib prefix="anotherexample" uri="http://anotherexample/taglib" %>
<example:tag1.................>
<anotherexample:tag2.................> etc2.
Mutliple tags per tld
Have multiple <tag> elements in your tld.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>j2ee</short-name>
<tag>
<name>tagName</name>
<tag-class>pkgName.classname</tag-class>
<body-content>JSP</body-content>
<display-name>OverlapTag</display-name>
<attribute>
<name>attr1</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>attr2</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>tag_2_Name</name>
<tag-class>pkgName.classname</tag-class>
<body-content>JSP</body-content>
<display-name></display-name>
<attribute>
<name>attr1_2</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>attr2_2</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
Interesting snippet
If you are using a 3rd party tag library, then the tags would come packaged in a jar file. The MTEA-INF directory of the jar file would contain the tlds and the tld would have an uri element. You can use it directly in the jsp without declaring the tld file in web.xml provided the jar file is in your classpath.
For example, take the struts tag libraries, say the logic tags.
The struts.jar contains, among other things, the tag class files and the tld files (inside /META-INF/tlds)
All you have to do is put Struts.jar in the classpath (easy way to do this is put it in the WEB-INF/lib directory of your web-application).
The jar file has struts-logic-1.1.tld in the META-INF/tlds directory.
This tld file looks like this
<taglib>
<tlibversion>1.2</tlibversion>
<jspversion>1.1</jspversion>
<shortname>logic</shortname>
<uri>http://jakarta.apache.org/struts/tags-logic</uri>
..................Now to use the tags in your jsp, you dont require the tld mappings in web.xml using the uri above in the taglib directive in your jsp
<%@ taglib prefix="example" uri="http://jakarta.apache.org/struts/tags-logic" %> cool, right ? :)
This is how you should pkg your own tags too. The tag classes have to be jarred and the tlds should go into the META-INF of the jar so that other users can simply add the jar to the cp and start using your tags.
cheers,
ram. -
Storing .jsp files in the web-inf directory
Has anyone ever heard about storing JSP files in the web-inf directory instead of the web app root directory.
Apparently it improves security.
If this is so, how is the user suppose to access the jsp file since I thought that users were not able to access what is stored in the web-inf directory.
Any thoughts
Thanks
NatI didn't tyr this but I think it is possible. You can do it using <servlet-mapping/> as you do with any other servlet.
For example include lines below, in web.xml of web-inf,
<servlet>
<servlet-name>ReportRouter</servlet-name>
<jsp-file>/web-inf/jsp/ReportRouter.jsp</jsp-file>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ReportRouter</servlet-name>
<url-pattern>/myrouter</url-pattern>
</servlet-mapping>
This may work. Don't you think so?
Sudha -
Is it possible to get control of the .SWF files in JSP files
Hi All
In my web application, I got 4 swf buttons which are created by flash and they are embedded in the jsp's. Each button perform the navigation to other page.
this is the jsp file.
<table width="100%" border="0">
<tr>
<td width="2%" height="26"> </td>
<td width="31%"> <object classid="clsid:...." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="BASE" value=".">
<param name="BGCOLOR" value="">
<param name="movie" value="button1.swf">
<param name="quality" value="high">
<embed src="button1.swf" width="100" height="22" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" base="." ></embed>
</object> <font size="-1" face="Arial, Helvetica, sans-serif"> </font></td>
<td width="67%" class="sitemapgy">*Add* </td>
</tr>
<tr>
<td height="26"> </td>
<td><object classid="clsid:..." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="BASE" value=".">
<param name="BGCOLOR" value="">
<param name="movie" value="button2.swf">
<param name="quality" value="high">
<embed src="button2.swf" width="100" height="22" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" base="." ></embed>
</object> </td>
<td class="sitemapgy">*Edit* ;</td>
</tr>
<tr>
<td height="26"> </td>
<td><object classid="clsid:..." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button13.swf">
<param name="quality" value="high">
<param name="base" value=".">
<embed src="button7.swf" base="." quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object></td>
<td class="sitemapgy">*Create*</td>
</tr>
<tr>
<td height="26"> </td>
<td><object classid="clsid:.." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="BGCOLOR" value="">
<param name="movie" value="main_print.swf">
<param name="quality" value="high">
<param name="base" value=".">
<embed src="main_print.swf" base="." quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object></td>
<td class="sitemapgy"><font face="Arial, Helvetica, sans-serif">*Print*</font></td>
</tr>
<tr>
<td height="26"> </td>
<td><object classid="clsid:..." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22" >
<param name="BGCOLOR" value="">
<param name="BASE" value=".">
<param name="movie" value="button3.swf">
<param name="quality" value="high">
<embed src="button3.swf" width="100" height="22" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" base="." ></embed>
</object></td>
<td class="sitemapgy"><font face="Arial, Helvetica, sans-serif">*_Admin_*</font></td>
</tr>
<tr>
<td height="24"> </td>
<td> </td>
<td> </td>
</tr>
</table>When I click the button3.swf (Admin) button....it navigates to other page...Before that I need to get control of swf button and need to perform some login checks.
Is it possible to get control?
ThanksThanks for your responses, I tried in the same way but when ever it looking at the path "/admin/admin_main.jsp",
its navigating to error page if the username is admin too(abcd).
Can you please help me regarding this.
I am sending you my code and web.xml.
<filter>
<filter-name>ExampleFilter</filter-name>
<filter-class>com.pack.db.ExampleFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ExampleFilter</filter-name>
<url-pattern>/admin/admin_main.jsp</url-pattern>
</filter-mapping>
import java.io.*;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.*;
public class ExampleFilter implements Filter {
private FilterConfig filterConfig=null;
public void init(FilterConfig config) throws ServletException {
this.filterConfig = config;
public void destroy() {
filterConfig = null;
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
RequestDispatcher rd = null;
String userInfo = "";
String userName="";
if (request instanceof HttpServletRequest) {
userInfo = ((HttpServletRequest) request).getUserPrincipal()
.getName();
String[] pieces = userInfo.split("\\\\"); // Firefox sends DOMAIN\USERNAME as UserPrincipal
userName = pieces[pieces.length -1]; // getting the username for which I need to perform check
if(userName!="abcd"){
System.out.println("userName IN ELSE PART:"+userName);
System.out.println("INVALID USER NAME");
rd = request.getRequestDispatcher("/admin/error.html");// i need to forward the response url to error page if the username is not equal to "abcd"
rd.forward(request, response);
else{
chain.doFilter(request, response); // if username="abcd" I need to navigate to normal pages.
Thanks -
How can I use a applet in a JSP file?
hi
I failed to use applet in a jsp file.My workspace is a BC4J type. I put the applet's source file in business component project.the jsp is in JSP project.
The jsp file calls applet by <jsp:plugin></jsp:plugin> style.
The error is can't find the applet class.
why? Thank someone for give me help.Actually using jsp applet tags does not mean that it is taking care of that the classes are available. It simply renders the Applet tag tothe JSP page. If e.g. teh codebase is specified as /java/, then there should be a mapping to the Java class location with thename of /java/. If codebase is not provided, then the Java class must be in the classpath of the JSp servlet.
Frank -
What's wrong with the JSP files?? Urgent Help Request
I have run some JSP files using Apache Tomcat 4.0 but I see many similar error message for the JSP files when running on the IE. I don't whether I should install some other software or components or just program errors in the JSP files.
The error messages are as follows:
javax.servlet.ServletException: oracle/xml/parser/v2/XMLParseException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457)
at org.apache.jsp.edit_0005fquiz_0005flist$jsp._jspService(edit_0005fquiz_0005flist$jsp.java:154)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
root cause
java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
at EntityBase.(EntityBase.java:18)
at QuizGen.(QuizGen.java:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:296)
at java.lang.Class.newInstance(Class.java:249)
at java.beans.Beans.instantiate(Beans.java:204)
at java.beans.Beans.instantiate(Beans.java:48)
at org.apache.jsp.edit_0005fquiz_0005flist$jsp._jspService(edit_0005fquiz_0005flist$jsp.java:122)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
And the reference JSP file is:
<%@page language="java" import="java.io.*, java.sql.*, DBSession, QuizGen"%>
<jsp:useBean id="sess" scope="session" class="DBSession"/>
<jsp:useBean id="quizGen" scope="session" class="QuizGen"/>
<%@include file="common.jsp"%>
<%
quizGen.setSession(sess);
quizGen.build();
quizGen.print(new PrintWriter(out), this.getURLPath(request, "edit_quiz_list.xsl"));
%>
another JSP file:
<%@page language="java" import="java.io.*, java.sql.*, eQuizMetadata"%>
<jsp:useBean id="eQuiz" scope="session" class="eQuizMetadata"/>
<%@include file="common.jsp"%>
<%
Integer nextQues = (Integer) session.getAttribute("eQuiz_nextQues");
session.setAttribute("eQuiz_nextQues", new Integer(nextQues.intValue()+1));
if (nextQues.intValue() > 0) {
if (request.getParameter("QueType").equals("F")) {
eQuiz.checkAnswer(request.getParameter("answer"));
else{
if (request.getParameter("QueType").equals("H")) {
eQuiz.checkAnswer(request.getParameter("map"));
else{
if(request.getParameter("QueType").equals("A")) {
String sAns = "";
if (request.getParameter("MAT1") != null) sAns += request.getParameter("MAT1");
if (request.getParameter("MAT2") != null) sAns += request.getParameter("MAT2");
if (request.getParameter("MAT3") != null) sAns += request.getParameter("MAT3");
if (request.getParameter("MAT4") != null) sAns += request.getParameter("MAT4");
eQuiz.checkAnswer(sAns);
else{
if (request.getParameter("Cardinality").equals("S"))
eQuiz.checkAnswer(request.getParameter("MC"));
else {
String sAns = "";
if (request.getParameter("MR1") != null) sAns += request.getParameter("MR1");
if (request.getParameter("MR2") != null) sAns += request.getParameter("MR2");
if (request.getParameter("MR3") != null) sAns += request.getParameter("MR3");
eQuiz.checkAnswer(sAns);
eQuiz.calAbility();
// meet one of the stopping criteria?
if (eQuiz.checkStopQuiz()) {
%>
<jsp:forward page="eQuiz_result.jsp"/>
<%
%>
<html>
<head>
<title>QuizML Management System</title>
</head>
<frameset border="0" rows="30,*">
<frame src="eQuiz_head.jsp" name="head" noresize scrolling="no">
<frame src="eQuiz_detail.jsp" name="detail" scrolling="auto">
</frameset>
</html>root cause
java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseExceptionYou simply don't have the "oracle.xml.parser.v2.XMLParseException" class in your classpath at run-time. -
What's wrong with the JSP file??Urgent Help Request
I have run some JSP files using Apache Tomcat 4.0 but I see many similar error message for the JSP files when running on the IE. I don't whether I should install some other software or components or just program errors in the JSP files.
The error messages are as follows:
javax.servlet.ServletException: oracle/xml/parser/v2/XMLParseException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457)
at org.apache.jsp.edit_0005fquiz_0005flist$jsp._jspService(edit_0005fquiz_0005flist$jsp.java:154)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
root cause
java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
at EntityBase.(EntityBase.java:18)
at QuizGen.(QuizGen.java:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:296)
at java.lang.Class.newInstance(Class.java:249)
at java.beans.Beans.instantiate(Beans.java:204)
at java.beans.Beans.instantiate(Beans.java:48)
at org.apache.jsp.edit_0005fquiz_0005flist$jsp._jspService(edit_0005fquiz_0005flist$jsp.java:122)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
And the reference JSP file is:
<%@page language="java" import="java.io.*, java.sql.*, DBSession, QuizGen"%>
<jsp:useBean id="sess" scope="session" class="DBSession"/>
<jsp:useBean id="quizGen" scope="session" class="QuizGen"/>
<%@include file="common.jsp"%>
<%
quizGen.setSession(sess);
quizGen.build();
quizGen.print(new PrintWriter(out), this.getURLPath(request, "edit_quiz_list.xsl"));
%>
another JSP file:
<%@page language="java" import="java.io.*, java.sql.*, eQuizMetadata"%>
<jsp:useBean id="eQuiz" scope="session" class="eQuizMetadata"/>
<%@include file="common.jsp"%>
<%
Integer nextQues = (Integer) session.getAttribute("eQuiz_nextQues");
session.setAttribute("eQuiz_nextQues", new Integer(nextQues.intValue()+1));
if (nextQues.intValue() > 0) {
if (request.getParameter("QueType").equals("F")) {
eQuiz.checkAnswer(request.getParameter("answer"));
else{
if (request.getParameter("QueType").equals("H")) {
eQuiz.checkAnswer(request.getParameter("map"));
else{
if(request.getParameter("QueType").equals("A")) {
String sAns = "";
if (request.getParameter("MAT1") != null) sAns += request.getParameter("MAT1");
if (request.getParameter("MAT2") != null) sAns += request.getParameter("MAT2");
if (request.getParameter("MAT3") != null) sAns += request.getParameter("MAT3");
if (request.getParameter("MAT4") != null) sAns += request.getParameter("MAT4");
eQuiz.checkAnswer(sAns);
else{
if (request.getParameter("Cardinality").equals("S"))
eQuiz.checkAnswer(request.getParameter("MC"));
else {
String sAns = "";
if (request.getParameter("MR1") != null) sAns += request.getParameter("MR1");
if (request.getParameter("MR2") != null) sAns += request.getParameter("MR2");
if (request.getParameter("MR3") != null) sAns += request.getParameter("MR3");
eQuiz.checkAnswer(sAns);
eQuiz.calAbility();
// meet one of the stopping criteria?
if (eQuiz.checkStopQuiz()) {
%>
<jsp:forward page="eQuiz_result.jsp"/>
<%
%>
<html>
<head>
<title>QuizML Management System</title>
</head>
<frameset border="0" rows="30,*">
<frame src="eQuiz_head.jsp" name="head" noresize scrolling="no">
<frame src="eQuiz_detail.jsp" name="detail" scrolling="auto">
</frameset>
</html>Your JSP refers to the class:
oracle/xml/parser/v2/XMLParseException
...which isn't in your webapps class path... you need to find the jar that contains the parser and drop it into WEB-INF/lib for your app, or the Tomcat lib directory.
Maybe you are looking for
-
Multiple IPods / Single Computer.
Is there a way to have multiple IPods synch to 1 computer with Itunes and each Ipod can synch to their own playlist. We have three I Pods and three computers and I want to consolidate and have one Mac with a whole lot of music to hook up to the stere
-
It's a recent problem. My default view now keeps coming up as "List", sorted z-a. And it returns to that even when I simply go up a directory level in the same transaction! I've deleted my Firefox prefs files as in the instructions for settings probl
-
Malfunction of bluetooth and WiFi with Ios7 and iphone 4s
Buon giorno, ho un IP 4S è ho fatto regolare aggiornamento a IOS 7.0.3, ho il Bluetooth che ricerca continuamente un contatto e non è disattivabile, e il WIFI che non si può attivare (rimane in grigetto per capirci). Contestualmente a tutto ciò la mi
-
Urgent - Connectivity between Oracle 8i and Forms5.0
I have installed Oracle 8i with the Oracle Home as c:\Oracle and Forms 5.0 with the Oracle Home as c:\Orant. But when I run Forms 5.0, it is not connecting with the database. The error is - The ordinal 2 could not be located in the dynamic link libra
-
I have recently used Entourage to access my cox email account, and I can receive all my mail. However, when I send mail, it doesn't actually send it. It makes weird beeping noises, and never sends?? How can I send my emails?