How to redirect to error.jsp, if servlet encounters error ??
how do i redirect to error.jsp file , if there is some error in my servlet file.
can i user response.sendRedirect() in catch clause or i should use RequestDispatcher in catch clause ??
You can use either way to redirect to error.jsp. If you want to pass your Request, response from servelet to JSP, then better to go for RequestDispatcher.
Similar Messages
-
Applet in jsp from servlet, but error: ClassNotFoundExcep
The problem that I'm having is already mentioned a couple of times in this forum, but unfortunately I haven't found a solution, in thread http://forum.java.sun.com/thread.jspa?forumID=33&threadID=239405 is proposed solution but it's not working for me.
I'm developing a project in IBM's Websphere Developer Studio 5.1.1. and JRE that I'm using for this project is 1.4.2. I have created servlet "CompanyDocument.java" and applet "SimpleApplet.java". Applet was created as single project and then imported into this one, that means that it's contained in current project as "SimpleAppletPackage.jar". I have placed jar in folder "Applets", Websphere automatically creates folder "simpleAppletPackage" and in it's root complied "SimpleApplet.class".
When I put following code in the jsp page applet works correctly when application is runed.
<APPLET code="simpleAppletPackage/SimpleApplet.class" codebase="Applets" archive="SimpleAppletPackage.jar" width="250" height="250"></APPLET>
But I wanted to create jsp from servlet. So I used this code within servlet:
out.print("<APPLET code=\"simpleAppletPackage/SimpleApplet.class\" codebase=\"Applets\"");
out.print("archive=\"SimpleAppletPackage.jar\" width=\"250\" height=\"250\"></APPLET>");
But I get an error (when running, no error when compiling). The error is copied from Java console:
load: class simpleAppletPackage/SimpleApplet.class not found.
java.lang.ClassNotFoundException: simpleAppletPackage.SimpleApplet.class
at sun.applet.AppletClassLoader.findClass AppletClassLoader.java:162)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:566)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:619)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:548)
at sun.applet.AppletPanel.run(AppletPanel.java:299)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:265)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:43)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:149)
... 9 more
In the same time I'm creating some more code from servlet and it works with no errors and is shown in browser properly (it consists of connection to Oracle, formatting table, and presenting data within that table).
Any idea? I'm totally stuck.In your browser, look at the HTML code that gets sent to the browser and see if there is something wrong with it.
Specifically, I would look at the code near the <APPLET ..></APPLET> tags, both before and after and look for stray quotes, brackets, or what not.
Finally, I would look inside the <APPLET ...> tag. It appears to me that the output will probably be:
<APPLET code="simpleAppletPackage/SimpleApplet.class" codebase="Applets"archive="SimpleAppletPackage.jar" width="250" height="250"></APPLET>See, you may be missing a space between the "Applets" and the archive=. Try making the second out.print look like this:
out.print(" archive=\"SimpleAppletPackage.jar\" width=\"250\" height=\"250\"></APPLET>"); See the extra space at the start of the output? -
How to go to new jsp from servlet.
In the results page, if a button is clicked, i go to servlet, then come back to display data from database in another page. It works fine but the problem is that I wnat to open up a new browser and display the target page there and not the results page.
results.jsp --> click button --> go to servlet --> display data on resultDetails.jsp (same browser window).
I want resultDetails.jsp in a new browser window.
my code in results.jsp is:
<input type = \"button\" onclick = \"location.href = 'Controller.wss?page=RESULT_DETAILS_PAGE&cmd_id="+cmdId+"'\" value = \"see details..\">
how can i change this. I am using java in jsp and out.println for any html content.
Thank you in advance. Any help (with/without) examples would be appreciated.
Bhavna.1. Create a jsp (popup.jsp) file with the content you want for the pop up window (eventually read some parameters from the request, if you need)
2. when creating the resultDetails.jsp generate a JavaScript that opens the pop-up jsp file using someting like:
<script>
window.open("popup.jsp?param1=<%=param1%>¶m2=<%=param1%>");
</script> -
Hi all,
I struckup with a doubt as fallows
How to pre-compile a JSP to Servlet(.class file) bfore the first request ,so that the first response takes same time as later responses.Thanx Ram for ur response,
I know Tomcat is assembled with Jasper compiler.My actual doubt is I want to precompile the Jsp bfore the first request. Actually the compilation occurs at the time of first request.U said it is server specific ,can u plz s let me know the pre-compile option for WEBLOGIC Server. -
Learning servlet, unresolve error
This is my first servlet that ive done using apache tomcat as my servlet container, and my code is
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Demo1 extends HttpServlet{
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{
PrintWriter pwOut = res.getWriter();
pwOut.println("Hello everybody!!!");
and my web.xml file code is
<?xml version="1.0"?>
<web-app>
<servlet>
<servlet-name>Demo1</servlet-name>
<servlet-class>Demo1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Demo1</servlet-name>
<url-pattern>/demo</url-pattern>
</servlet-mapping>
</web-app>
Please can anyone help me to determine what causes this error.
exception
javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:595)
root cause
java.lang.UnsupportedClassVersionError: Bad version number in .class file
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:595)Yes I think so, I set my environment variable path to jdk1.5.0_10
C:\>java -version
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)
and my tomcat server information are: (I copy and paste from tomcat manager page)
Tomcat Version: Apache Tomcat/5.5.26
JVM Version: 1.5.0_10-b03
......others
and I used Texpad to compile my servlet -
How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
using RequestDispatcher..its not possible..becoz
RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
rd.foward(req,res);
Here the request and response are null objects..
So mi question can frame as how can i get request/response in servlet's init method()..Hi guys
did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:519)
at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
so plz do let me know how to call a jsp in the start up of a servlet.
Thanks
Vidya -
Error message from servlet to jsp
Hi again,
I have servlet and check error on this servlet then i would like
to send error message to jsp page.Every error message will send to
same JSP page.So JSP must receive message from Servlet.Can i do this?
Please give me details and some sourcecode.I will appreciate for your helps.you could do something like this..
request.setAttribute("error", stringErrormessage);
Then in the jsp just do
<%= request.getAttribute("error") %>
That will print an errormessage.
Basically, by setting anything on the request and then redirecting to that page you cn display it...
//Johan -
How to redirect to an error page when database is down
We have build an struts/jsp-application with JDeveloper 10g and ADF. If the connection to the database fails, we get a plain page with header "500 Internal Server Error" and the exception and a stack trace. Of course we want to catch this exception and redirect the user to an error page with all of the standard design elements of our site and with a textual description of the error of our one choice.
Our attempts to solve this includes adding error-page tags with error-code and exception-type:
<error-page>
<exception-type>javax.servlet.jsp.JspTagException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>oracle.jbo.JboException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>oracle.jbo.DMLException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>java.sql.SQLException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>error.jsp</location>
</error-page>
Are there other ways to do this, or are there things we have forgotten to do, that has to be done for this solution to work.
We have also tried try and catch in a variety of the lifecycle methods in the DataAction subclass for the page, but none of these are ever called. It seems the error happens before the first lifecyle method starts. We can't figure out where to catch this exception.
In other cases the web.xml mechanism seems to work.Try the Global Exception Mechanism within Struts...
-
How to post an audio file in JSP or servlet
Hi,
I've loaded some rm files into the database. How do I retrieve and post it to the web using JSP or servlet page? How do I convert the ORDAUDIO to BLOB field? I went to the following example/demo:
http://www.oracle.com/technology/sample_code/products/intermedia/index.html
but didn't gain much help. Please provide me some sample codes using embeded tag. Thanks!
Regards,
JohnnyI''l try again.....
The response to your http page does not include media of any kind. The media is not part of your web response. It takes another request to get the media.
Your embed tag, image tag, object tag, anchor tag only reference the media data. Typically , in the case of an image, by a relative URL.
Your OrdAudio object can only provide the mimetype and other metadata when you are building your web page. You must have another endpoint to handle the delivery of binary media.
A simple servlet is typically used, Consider the following servlet. It delivers a HTML form, or Image media, depending on what the request parameter "what" is set to. If "what" is set to "form", it delivers an HTTP form that references this same servlet, except that in the image tag "what" is set to image, where the image object is fetched, and the binary media delivered (with the right mimetype). Just change the Image stuff to audio, the html image tag to an anchor or embed tag, and something like this should work for audio as well.
This is a bit better... , the <img src= is messed up, as are the <h1> tags...
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Types;
import java.sql.PreparedStatement;
import javax.servlet.ServletException;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.naming.NamingException;
import oracle.jdbc.OracleResultSet;
import oracle.jdbc.pool.OracleConnectionPoolDataSource;
import oracle.jdbc.pool.OraclePooledConnection;
import oracle.jdbc.driver.OracleConnection;
import oracle.ord.im.OrdImage;
import oracle.ord.im.OrdHttpResponseHandler;
import oracle.ord.im.OrdMultipartWrapper;
public class deliveryServlet extends HttpServlet
OracleConnection conn = null;
String servletURL = null;
* Servlet initialization method.
public void init( ServletConfig config ) throws ServletException
super.init(config);
* Get a pooled database connection
private void getPooledConnection() throws SQLException, NamingException
javax.naming.InitialContext ic = new javax.naming.InitialContext();
OracleConnectionPoolDataSource ds = (OracleConnectionPoolDataSource)
ic.lookup("jdbc/pool/OracleMediaPoolDS");
OraclePooledConnection pc = (OraclePooledConnection)
ds.getPooledConnection();
conn = (OracleConnection)pc.getConnection();
// conn.setAutoCommit(false); // just query. No need for this
* Process an HTTP GET request used to deliver an image column
public void doGet( HttpServletRequest request,
HttpServletResponse response )
throws ServletException, IOException
String id = request.getParameter( "id" );
String what = request.getParameter( "what" );
if (!"image".equalsIgnoreCase(what)) what = "form"; // set a default
if ("form".equalsIgnoreCase(what))
String servletURL = request.getRequestURL().toString();
try
if (conn == null) getPooledConnection();
PrintWriter out = response.getWriter();
response.setContentType( "text/html" );
out.println( "<HTML><BODY>" +
"<H1>Display Images</H1>" +
"<FORM action=\"" + servletURL + "\">" +
" Enter Row ID:<INPUT type=\"text\" name=\"id\" /><BR/>");
if (id != null)
PreparedStatement stmt =
conn.prepareStatement("select description, location, " +
"thumb, image "+
" from photos where id = ?" );
stmt.setString( 1, id );
OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
// Fetch the row from the result set.
if ( rset.next() )
// Get columns from query
String location = rset.getString(1);
String description = rset.getString(2);
OrdImage thumb =
(OrdImage)rset.getORAData(3, OrdImage.getORADataFactory());
OrdImage img =
(OrdImage)rset.getORAData(4, OrdImage.getORADataFactory());
out.println("<B>Description: </B>" + description+ "<BR/>");
out.println("<B>Location: </B>" + location+ "<BR/>");
if (thumb != null && thumb.getMimeType().startsWith("image/"))
String thmbWidthStr = thumb.getWidth() == 0 ? "" :
"WIDTH=\"" + thumb.getWidth() + "\" ";
String thmbHeightStr = thumb.getHeight() == 0 ? "" :
"HEIGHT=\"" + thumb.getHeight() + "\" ";
out.println("<B>Thumbnail: </B>" +
"<IMG SRC=\"" + servletURL + "?id=" + id +
"&what=image&col=thumb\" " +
thmbWidthStr +
thmbHeightStr +
"/>" );
if (img != null && img.getMimeType().startsWith("image/"))
String imgWidthStr = img.getWidth() == 0 ? "" :
"WIDTH=\"" + img.getWidth() + "\" ";
String imgHeightStr = img.getHeight() == 0 ? "" :
"HEIGHT=\"" + img.getHeight() + "\" ";
out.println("<B>Image: </B>" +
"<IMG SRC=\"" + servletURL + "?id=" + id +
"&what=image&col=image\" " +
imgWidthStr +
imgHeightStr +
"/>" );
else
// Print not found
out.println("<H2>Row with ID\"" + id + "\" Not Found</H2><BR/>");
out.println("</FORM></BODY></HTML>");
catch (Exception e)
conn = null; // Get another connection next time.
throw new ServletException(e);
else
try
if (conn == null) getPooledConnection();
String col = request.getParameter("col");
if (col == null) col = "thumb"; // default to the thumbnail column
PreparedStatement stmt =
conn.prepareStatement( "select " + col +
" from photos where id = ? " );
stmt.setString( 1, id );
OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
// Fetch the row from the result set.
if ( rset.next() )
// Get the OrdImage object from the result set.
OrdImage img =
(OrdImage)rset.getORAData(1, OrdImage.getORADataFactory());
// Create an OrdHttpResponseHandler object, then use it to retrieve
// the image from the database and deliver it to the browser.
OrdHttpResponseHandler handler =
new OrdHttpResponseHandler( request, response );
handler.sendImage( img );
else
// Row not found, return a suitable error.
response.setStatus( response.SC_NOT_FOUND );
// Close the result-set and the statement.
rset.close();
stmt.close();
catch (Exception e)
conn = null; // Get another connection next time.
throw new ServletException(e); -
How to redirect in java code not the jsp or any other
hello
can any one help me how to redirect in java pages the code must be in java function not in jsp or any thing else
thanks in advanceFunction? Don't you rather mean method?
Anyway, in JSF you can send a redirect using ExternalContext#redirect(). If your JSF environment is on top of JSP/Servlet, then under the hood it basically invokes HttpServletResponse#sendRedirect() and FacesContext#responseComplete(). -
Hi master
Sir I use orace 9i easily in java class with following code
===========
import java.sql.*;
public class ttst {
public ttst() {
public static void main (String args [])
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select accid from accbal where accid='K1101'");
System.out.println ("going for connection");
while (rset.next())
s= rset.getString("accid");
System.out.println (s);
catch(Exception e){
e.printStackTrace();
system give me right result
and when I use jsp with this code
<HTML>
<%@ page import="java.sql.*,java.util.*" %>
<% String url="jdbc:oracle:thin:@fahim:1521:aamir";
Connection con;
Statement stmt;
ResultSet rs;
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con = DriverManager.getConnection(url,"muhammad","mfa786");
stmt=con.createStatement();
%>
<%
%>
<select name="ltpid">
<%
try{
rs= stmt.executeQuery("select accid,title from chartofacc");
while (rs.next()){
%>
<option Value=<%=rs.getString(1)%>> <%=rs.getString(2) %> </option>
<%
catch(Exception e){}
%>
</select>
<br>
TEST DONE!
</HTML>
sir I have class12.zip and class11.zip I same folder
but system give me this error
Apache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: oracle.jdbc.driver.OracleDriver
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.bistest$jsp._jspService(bistest$jsp.java:128)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
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.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:226)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
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:190)
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.netbeans.modules.web.monitor.catalina.MonitorValve.invoke(MonitorValve.java:148)
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:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
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:468)
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:174)
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:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)
root cause
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:198)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.apache.jsp.bistest$jsp._jspService(bistest$jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
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.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:226)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
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:190)
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.netbeans.modules.web.monitor.catalina.MonitorValve.invoke(MonitorValve.java:148)
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:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
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:468)
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:174)
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:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)
but jsp page not run
please give me idea how I how my oracle data in jsp page
thank
aamirsir i post my problem but they reply me it java problem not oracle problem
*** oracle reply**********
You metioned that you use
jdbc:oracle:thin:@<ip or hostname of machine where your db is installed>: 1521:aamir , description to connect the remote database. So, I think it's not related to your tnsname.ora problem. It's only java oracle thin connection string. Please check this string, make sure the ip and database service name is right.
one more thing, use sqlplus check your tnsname.ora, if ok, then try to check jdbc and make sure the jdbc driver match to oracle server.
sir please give me idea how i show my oracle data in clinet browser
thank's
aamir -
How to cluster the war file conatining the jsp and servlet by using wl6.0sp1?
There three wlsever6.0 sp1.
One is admin server and doesn't join the cluster.
Two servers are cluster server.
I use the admin console to deploy the war file and the war file conatains
the jsp and servlet.
How to config the one of the clustered servers as the primary one, so that
the client can request the jsp?
If the one of the clustered servers is closed, can the client be redirected
to another clustered server?
Does the proxy server need to be exist?
There three wlsever6.0 sp1.
One is admin server and doesn't join the cluster.
Two servers are cluster server.
I use the admin console to deploy the war file and the war file conatains
the jsp and servlet.
How to config the one of the clustered servers as the primary one, so that
the client can request the jsp?
If the one of the clustered servers is closed, can the client be redirected
to another clustered server?
Does the proxy server need to be exist?
-
How to track the same session using both jsp and servlets
Hello, guys:
"how to use jsp and servlet to track the same session",
it seems to me my logoff.jsp never realize the session I established in my servlets.
Here is how I set my session in my servlets:
" HttpSession session = req.getSession(true);
session.setAttribute("userid",suserid);"
Here is how I invalidate my session in my logoff.jsp
" <%@ page language= "java" %>
<%@ page import="javax.servlet.http.HttpSession" %>
<%@ page session="false"%>
Our Session id is : <%= session.getId() %>
<% session.removeAttribute("userid");
session.invalidate();
%>
Our Session id is : <%= session.getId() %>"
but when I try to logoff using the logoff.jsp
I always get following error message.
"/home/jiao/jsp_webserver/tomcat/work/Standalone/localhost/syllabus/htmls/logoff_jsp.java:50: cannot resolve symbol
symbol : variable session
location: class org.apache.jsp.logoff_jsp
out.print( session.getId() );"
T.I.A.
[Edited by: jiveadmin on Jun 18, 2003 10:32 AM]
[Edited by: jiveadmin on Jun 18, 2003 10:33 AM]So,
<%@ page session="false"%>
That means the jsp never instantiates the build in session object.
<%@ page session="true"%>
means jsp will instantiates a session object if there are no existing ones
how about I just delete the line,
does that mean the jsp will find the existing session object for me?
So I can do something like
Our Session id is : <%= session.getId() %>
<% session.removeAttribute("userid");
session.invalidate();
%>
directly.
T.I.A. -
Sends URL to my jsp or servlet then it redirects to an ext. site http post
Hi,
A user sends URL request to my jsp or servlet and then it redirects to an external site with a http or https post (not get). The post has a number of name/value parameters that are sent with it.
How can I accomplish this?
Thanks,
Johnhttp://java.sun.com/products/jsp/tags/11/syntaxref11.fm9.html
-
How to get an ArrayList Object in servlet from JSP?
How to get an ArrayList Object in servlet from JSP?
hi all
please give the solution for this without using session and application...
In test1.jsp file
i am setting values for my setter methods using <jsp:usebean> <jsp:setproperty> tags as shown below.
After that i am adding the usebean object to array list, then using request.setAttribute("arraylist object")
---------Code----------
<jsp:useBean id="payment" class="com.common.PaymentHandler" scope="request" />
<jsp:setProperty name="payment" property="strCreditCardNo" param="creditCardNumber" />
<%-- <jsp:setProperty name="payment" property="iCsc" param="securityCode" /> --%>
<jsp:setProperty name="payment" property="strDate" param="expirationDate" />
<jsp:setProperty name="payment" property="strCardType" param="creditCardType" />
<%--<jsp:setProperty name="payment" property="cDeactivate" param="deactivateBox" />
<jsp:setProperty name="payment" property="fAmount" param="depositAmt" />
<jsp:setProperty name="payment" property="fAmount" param="totalAmtDue" /> --%>
<jsp:useBean id="lis" class="java.util.ArrayList" scope="request">
<%
lis.add(payment);
%>
</jsp:useBean>
<%
request.setAttribute("lis1",lis);
%>
-----------Code in JSP-----------------
In testServlet.java
i tried to get the arraylist object in servlet using request.getAttribute
But I unable to get that arrayObject in servlet.....
So if any one help me out in this, it will be very helpfull to me..
Thanks in Advance
EdwardHi,
Im also facing the similar problen
pls anybody help..
thax in advance....
Litty
Maybe you are looking for
-
I'm still trying to get a definitive answer to this question. My applet is not "Next Generation compliant". When we run our applet in Internet Explorer it runs fine as long as we disable the "Next Generation Plugin" via the Java plugin control panel.
-
Hi, My client has a requirement to produce detail reports using OBIEE. We have 11g now, I remember in 10G there was a limitation of 10,000 rows, is that the same in 11G. In case if it runs over, how to manage it. Is there any other alternate, can BI
-
Extract of gr processing time in open purchase order
to display gr processing time in open purchase order .give me query for extract the gr processing time which table and which field we have to take
-
HAL doesn't recognize my ext. drive with 1500GB, the 500GB one works
Hi there Some days ago I bought a 1500GB external harddrive, but after plugin it in via USB, it doesn't appear in my file manager. I tested it with thunar and pcmanfm, with both it didn't work. I don't think, that it's their fault, I think HAL doesn'
-
HT1539 Does anyone know if digital copies have subtitle facility for Hard of Hearing?
I have downloaded digital of Les Miserables today- and am reluctant to do any more until I can find out if the subtitle facility is available in this format for viewing on Ipad. Can anyone help?