Search Results

Search found 1589 results on 64 pages for 'servlet'.

Page 6/64 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Nightmare: Upgrading Tomcat 5.5 to 6.0

    - by pavanlimo
    I'm trying to upgrade a perfectly running embedded Tomcat 5.5 to Tomcat 6.0. I understand that all I need to do is replace Tomcat 5.5 jars with 6.0. That's what I did. So I replaced the following jars: catalina-5.0.28.jar catalina-5.5.9.jar catalina-optional-5.5.9.jar commons-el.jar commons-modeler-1.1.0.jar jasper-compiler-jdt.jar jasper-compiler.jar jasper-runtime.jar jmx-5.0.28.jar jsp-api-2.0.jar naming-factory.jar naming-resources.jar servlet-api-2.4.jar servlets-default.jar tomcat-coyote.jar tomcat-http.jar tomcat-util.jar with: annotations-api.jar catalina.jar jasper.jar tomcat-dbcp.jar catalina-ant.jar el-api.jar jsp-api.jar tomcat-i18n-es.jar catalina-ha.jar jasper-el.jar servlet-api.jar tomcat-i18n-fr.jar catalina-tribes.jar jasper-jdt.jar tomcat-coyote.jar tomcat-i18n-ja.jar tomcat-juli.jar As soon as I start the server, I get the following message in the logs at INFO level: INFO: Starting Servlet Engine: Apache Tomcat/6.0.29 Dec 31, 2010 6:04:18 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(/usr/local/blah/blue/./WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Based on the this explanation, I need to remove a jar file which has a conflicting Servlet.class. I swear to God, there is no other conflicting jar file, I grepped system wide for Servlet.class, it matched only servlet-api.jar. I also downloaded javaee.jar and replaced it by servlet-api.jar, to same avail. Having tried lot of these stuff, I did not have much to look upto, so set the tomcat logging level to ALL. In the log I could see that it is trying to check for Servlet.class in each and every jar it is loading until it finds servlet-api.jar and throws "jar not loaded" message as soon as it finds servlet-api.jar. See below: FINE: Checking for javax/servlet/Servlet.class Jan 2, 2011 7:39:33 AM org.apache.catalina.loader.WebappLoader setRepositories FINE: Deploy JAR /WEB-INF/lib/servlet-api.jar to /usr/local/blah/blue/./WEB-INF/lib/servlet-api.jar Jan 2, 2011 7:39:33 AM org.apache.catalina.loader.WebappClassLoader addJar FINE: addJar(/WEB-INF/lib/servlet-api.jar) Jan 2, 2011 7:39:33 AM org.apache.catalina.loader.WebappClassLoader validateJarFile FINE: Checking for javax/servlet/Servlet.class Jan 2, 2011 7:39:33 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(/usr/local/blah/blue/./WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Jan 2, 2011 7:39:33 AM org.apache.catalina.loader.WebappLoader setRepositories Please note however, that Tomcat starts successfully! And as soon as I hit the URL on the browser, I get blank page(this may be in my case only, I guess 'cuz of my web.xml, sorta different from most. Other people on the internet have got Error 404 instead.) with following log statements(at finest level) Jan 2, 2011 9:40:01 AM org.apache.catalina.connector.CoyoteAdapter parseSessionCookiesId FINE: Requested cookie session id is 0FBA716E3F9B0147C3AF7ABAE3B1C27B Jan 2, 2011 9:40:01 AM org.apache.catalina.authenticator.AuthenticatorBase invoke FINE: Security checking request GET /login.jsp Jan 2, 2011 9:40:01 AM org.apache.catalina.realm.RealmBase findSecurityConstraints FINE: Checking constraint 'SecurityConstraint[protected]' against GET /login.jsp --> false Jan 2, 2011 9:40:01 AM org.apache.catalina.realm.RealmBase findSecurityConstraints FINE: Checking constraint 'SecurityConstraint[protected]' against GET /login.jsp --> false Jan 2, 2011 9:40:01 AM org.apache.catalina.realm.RealmBase findSecurityConstraints FINE: Checking constraint 'SecurityConstraint[protected]' against GET /login.jsp --> false Jan 2, 2011 9:40:01 AM org.apache.catalina.realm.RealmBase findSecurityConstraints FINE: Checking constraint 'SecurityConstraint[protected]' against GET /login.jsp --> false Jan 2, 2011 9:40:01 AM org.apache.catalina.realm.RealmBase findSecurityConstraints FINE: No applicable constraint located Jan 2, 2011 9:40:01 AM org.apache.catalina.authenticator.AuthenticatorBase invoke FINE: Not subject to any constraint Jan 2, 2011 9:40:01 AM org.apache.catalina.core.StandardWrapper allocate FINEST: Returning non-STM instance I'm not sure if the above log message is important, but I'm for all-out disclosure here. One interesting thing though, I manually created a dummy jsp file containing only "helloooo" just outside WEB-INF folder(no security constraints for this file). This file was accessible and could be displayed. But, all my jsp's and classes are inside WEB-INF(ofcourse). Sick and tired of this issue, please help me solve it. I've already spent 20-24 hours on this unsuccessfully. Any pointers directions hints leads?

    Read the article

  • EOFException in ObjectInputStream thrown accessing Servlet. Only for Webstart ?!

    - by Houtman
    Hi, My app. is started from both the commandline and by using an JNLP file. Im running java version 1.6.0_14 First i had the problem that i created the Buffered input and output streams in incorrect order. Found the solution here at StackOverflow . So starting from the commandline works fine now. But when starting the app using Webstart, it ends here java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source) at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at java.io.ObjectInputStream.<init>(Unknown Source) at <..>remoting.thinclient.RemoteSocketChannel.<init>(RemoteSocketChannel.java:76) I found some posts regarding similar problems; at bugs.sun.com - identifies problem as solved in 6u10(b12)? at ibm.com - identifies cookies problem The latter suggests that there is a problem in Webstart with cookies. It doesn't seem to be acknowledged as a proper java bug though.. Still i am a bit lost in the solution provided regarding the cookies. Can anyone expand on the cookie solution? Many thanks.

    Read the article

  • How do I redirect to the current page in Servlet Filter?

    - by JeffJak
    I have a page say: /myapp/test.jsp?queryString=Y. The filter needs to redirect to current page. It should go to /myapp/test.jsp (without the query string). The below seems to bring it to to the context root: /myapp. I am running in WAS6.1. public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest) req; HttpServletResponse httpResp = (HttpServletResponse) resp; { boolean blnNeedToRedirect = true; if (blnNeedToRedirect) { httpResp.sendRedirect("."); return; } chain.doFilter(req, resp); }

    Read the article

  • Java Servlet framework that does things like rencoding images to preferred format etc.

    - by mP
    Are there any frameworks/libraries that provide servlets/filters etc that handle reencoding on the fly of images. interpret the accept headers and output the file, reencoding into the new format if necessary by checking the actual format of the original image file. provide a low and high quality version of an image. re encode an image into new dimensions. width and height parameters might query string parameters. I could create versions of the file in all the formats, at upload time but the seems overkill. I would rather lazily create the rencoded file and stick it in a cache if it gets served again etc.

    Read the article

  • Servlet : Usage of Constants.java class vs context param

    - by Pongsakorn Semsuwan
    I'm just wondering whether to keep some of my variables in Constants class or keep it in web.xml Say, I want to keep a variable of Facebook graph API prefix or api_key, client_id From my understand, the difference between Constants.java and web.xml is web.xml is easier to rewrite on compile using ant. So, you can replace your variables in web.xml according to what environment you are building you app for. (client_id varies by development environment/production environment, for example) If I understand it right, then Facebook graph API prefix should be kept in Constants.java (because it always is "https://graph.facebook.com/") and api_key, client_id should be kept in web.xml? What's the proper way to use them?

    Read the article

  • Uploadify plugin doesn't call Java Servlet

    - by sergionni
    Hello,i just started using Uploadify flash plugin instead of standard HTML UI. And met the next problem: when I click "Upload Files" link,that progress is shown and "completed" status is appeared, but in reality - it didn't happened anything,Java Servlet isn't called from backend. There is upload servlet and uploading performed next way earlier: < form enctype="multipart/form-data" method="post" target="uploadFrame" action="<%= request.getContextPath() %>/uploadFile?portletId=${portletId}&remoteFolder=${remoteFolder}">... After providing Uploadify plugin, UI now looks like: plugin part(configuration): <script> ... oScript.text+= "$j('#uploadify').uploadify({"; oScript.text+= "'uploader' : 'kne-portlets/js/lib/uploadify/scripts/uploadify.swf',"; oScript.text+= "'script' : '<%= request.getContextPath() %>/uploadFile?portletId=${portletId}&remoteFolder=<%= decodedString %>',"; oScript.text+= "'cancelImg': 'kne-portlets/js/lib/uploadify/cancel.png',"; oScript.text+= "'folder' : '<%= decodedString %>',"; oScript.text+= "'queueID' : 'fileQueue',"; oScript.text+= "'auto' : false,"; oScript.text+= "'multi' : false,"; //oScript.text+= "'sizeLimit' : 1000"; oScript.text+= "});"; oScript.text+= "});"; ... </script> 'scripts' parameter here points to Java Servlet on backend <%= decodedString %> is folder path, which value is \\file-srv\demo part for uploading: <input type="file" name="uploadify" id="uploadify" /> <a href="javascript:$j('#uploadify').uploadifyUpload();">Upload Files</a> Where is my fault? 'Script' param in plugin config points to Java Servlet on backend and it's done,but Servlet isn't triggered. error, when 'script' param isn't correct:http://img190.imageshack.us/i/errormm.png/ Thank you for assistance.

    Read the article

  • Servlet Profiling

    - by MontyBongo
    What is the best way to undertake Servlet profiling? In particular I am looking for a solution that can show the execution times of the method calls within the servlet. I am running the Servlet within a Tomcat environment. I have tried VisualVM but it only allows me to see the method calls from the Tomcat thread rather than the Servlets themselves.

    Read the article

  • java servlet programming errror

    - by abson
    C:\Tomcat5.5\webapps\WEB-INF\classes>javac MyServlet.java MyServlet.java:2: package javax.servlet does not exist import javax.servlet.*; ^ MyServlet.java:3: package javax.servlet.http does not exist import javax.servlet.http.*; ^ MyServlet.java:5: cannot find symbol symbol: class HttpServlet public class MyServlet extends HttpServlet ^ MyServlet.java:7: cannot find symbol symbol : class HttpServletRequest location: class MyServlet public void doGet(HttpServletRequest req, HttpServletResponse res) throws Serv letException,IOException ^ MyServlet.java:7: cannot find symbol symbol : class HttpServletResponse location: class MyServlet public void doGet(HttpServletRequest req, HttpServletResponse res) throws Serv letException,IOException ^ MyServlet.java:7: cannot find symbol symbol : class ServletException location: class MyServlet public void doGet(HttpServletRequest req, HttpServletResponse res) throws Serv letException,IOException ^ 6 errors

    Read the article

  • Grails + GAE - Issue using app.servlet.version=2.5

    - by Taylor L
    Updating the servlet version in application.properties to 2.5 has no affect on the generated web.xml. The generated web.xml is still version 2.4. app.servlet.version=2.5 Also, if I try to execute "run-app" I get the exception below: Running Grails application.. Starting AppEngine generated indices thread. Starting reload monitor thread. [java] Jan 26, 2010 5:27:05 AM com.google.apphosting.utils.jetty.JettyLogger warn [java] WARNING: Failed startup of context com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@4178460d{/,C:\Users\Taylor Leese\workspace\test-gae\web-app} [java] java.lang.IllegalStateException: No such servlet: grails [java] at org.mortbay.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:953) [java] at org.mortbay.jetty.servlet.ServletHandler.setServletMappings(ServletHandler.java:1037) [java] at org.mortbay.jetty.webapp.WebXmlConfiguration.initialize(WebXmlConfiguration.java:305) [java] at org.mortbay.jetty.webapp.WebXmlConfiguration.configure(WebXmlConfiguration.java:222) [java] at org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp(WebXmlConfiguration.java:180) [java] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1215) [java] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) [java] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) [java] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) [java] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) [java] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) [java] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) [java] at org.mortbay.jetty.Server.doStart(Server.java:217) [java] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) [java] at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:188) [java] at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:120) [java] at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:217) [java] at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:162) [java] at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48) [java] at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113) [java] at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89) [java] The server is running at http://localhost:8080/ Any ideas how to resolve these issues?

    Read the article

  • Servlet stops without giving any exception

    - by Fahim
    Hi, I have implemented a Servlet hosted on Tomcat 6 server on Mandriva Linux. I have been able to make the client communicate with the Servlet. In response to a request the Servlet tries to instantiate a another class (named KalmanFilter) located in the same directory. The KalmanFilter tries to create four Matrices (using Jama Matrix package). But at this point Servlet stops without giving any exception ! However, from another test code in the same directory I have been able to create instance of KalmanFilter class, and proceed without any error. The problem occurs only when my Servlet tries to instantiate the KalmanFilter class and create the matrices. Any idea? Below are the codes: MyServlet.java import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; public class MyServlet extends HttpServlet { public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ doGet(request, response); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException{ PrintWriter out = null; //response.getWriter(); try{ System.out.println("creating new KalmanFilter"); KalmanFilter filter = new KalmanFilter(); out = response.getWriter(); out.print("filter created"); }catch(Exception ex){ ex.printStackTrace(); System.out.println("Exception in doGet(): " + ex.getMessage()); ex.printStackTrace(out); } } } KalmanFilter.java import Jama.Matrix; public class KalmanFilter { protected Matrix X, X0; protected Matrix F, Q; //protected Matrix F, B, U, Q; protected Matrix H, R; protected Matrix P, P0; private final double EPSILON = 0.001; public KalmanFilter(){ System.out.println("from constructor of KalmanFilter"); createInitialMatrices(); } private void createInitialMatrices(){ System.out.println("from KalmanFilter.createInitialMatrices()"); double[][] pVals = { {1.0, 0.0}, {0.0, 1.0} }; double[][] qVals = { {EPSILON, EPSILON}, {EPSILON, EPSILON} }; double[][] hVals = { {1.0, 0.0}, {0.0, 1.0}, {1.0, 0.0}, {0.0, 1.0} }; double[][] xVals = { {0.0}, {0.0}, }; System.out.println("creating P Q H X matrices in createInitialMatrices()"); try{ this.P = new Matrix(pVals); System.out.println("created P matrix in createInitialMatrices()"); this.Q = new Matrix(qVals); System.out.println("created Q matrix in createInitialMatrices()"); this.H = new Matrix(hVals); System.out.println("created H matrix in createInitialMatrices()"); this.X = new Matrix(xVals); System.out.println("created X matrix in createInitialMatrices()"); System.out.println("created P Q H X matrices in createInitialMatrices()"); }catch(Exception e){ System.out.println("Exception from createInitialMatrices()"+ e.getMessage()); e.printStackTrace(); } System.out.println("returning from createInitialMatrices()"); } }

    Read the article

  • Generate JFreeChart in servlet

    - by San4o
    I'm trying to generate graphs using JFreeChart. I added record in web.xml, installed jfreechart library. Compiled servlet. Below code of servlet has shown: import java.io.IOException; import java.io.OutputStream; import java.io.File; import javax.servlet.*; import javax.servlet.http.*; import java.awt.Color; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; import org.jfree.data.general.DefaultPieDataset; public class diagram extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doTestPieChart(request,response); } protected void doTestPieChart(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { OutputStream out = response.getOutputStream(); try { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("Graphic Novels", 192); dataset.setValue("History", 125); dataset.setValue("Military Fiction", 236); dataset.setValue("Mystery", 547); dataset.setValue("Performing Arts", 210); dataset.setValue("Science, Non-Fiction", 70); dataset.setValue("Science Fiction", 989); JFreeChart chart = ChartFactory.createPieChart( "Books by Type", dataset, true, false, false ); chart.setBackgroundPaint(Color.white); response.setContentType("image/png"); ChartUtilities.writeChartAsPNG(out, chart, 400, 300); /* ServletContext sc = getServletContext(); String filename = sc.getRealPath("pie.png"); File file = new File(filename); ChartUtilities.saveChartAsPNG(file,chart,400,300); */ } catch (Exception e) { System.out.println(e.toString()); } finally { out.close(); } } } When i launch the servlet, mistake has shown : HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Error instantiating servlet class diagram org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:619) root cause java.lang.NoClassDefFoundError: org/jfree/data/general/PieDataset java.lang.Class.getDeclaredConstructors0(Native Method) java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) java.lang.Class.getConstructor0(Class.java:2699) java.lang.Class.newInstance0(Class.java:326) java.lang.Class.newInstance(Class.java:308) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:619) root cause java.lang.ClassNotFoundException: org.jfree.data.general.PieDataset org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329) java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) java.lang.Class.getDeclaredConstructors0(Native Method) java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) java.lang.Class.getConstructor0(Class.java:2699) java.lang.Class.newInstance0(Class.java:326) java.lang.Class.newInstance(Class.java:308) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:619) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs. Help me to solve a problem. and where is problem?

    Read the article

  • cookie name is truncated in Servlet 3.0 HttpServletRequest (Glassfish V3)

    - by idplmal
    I'm porting our Web authentication/authorization middleware for use in containers implementing the new servlet 3.0 API (Glassfish V3 in this case). The middleware pulls cookies from the HttpServletRequest filtering on cookies with names of the form "DACS:FEDERATION::JURISDICTION:username". This works fine in the version 2.5 servlet API but is broken in 3.0. The cookie names in 3.0 are being truncated at the first ":" in the name. I understand that the servlet 3.0 implementation defaults to RFC 2109 cookies which are more restrictive about cookie names than the old Netscape spec (":" is among the characters not allowed in RFC 2109 cookie names). Digging into the servlet 3.0 source code, it appears that the use of RFC2109 names can be disabled by setting a System property "org.glassfish.web.rfc2109.cookie_names_enforced" to false. I've tried this to no avail. But besides that, the code that uses checks cookie names is in the constructor for Cookie, and it would appear that the truncation is occurring elsewhere. So - finally - the question. Have others bumped into such issues in the servlet 3.0 API and have you found a work around?

    Read the article

  • Post method in Servlet is not being called again after being executed once

    - by SaurabhCsIITKgp
    I am implementing a database based web application using servlets. Now, when I input a parameter using a form in the jsp page, it redirects it to a servlet which subsequently adds the value to the database (the servlet creates a new table if the table doesn't already exist). The creation of the table and the addition of value works fine if the table doesn't already exists. Once it is created however and the parameter is inputted again in the form, the submit button no longer redirects it to the servlet. Nor is the value added to the database. Kindly advise me as to where I am going wrong. Following are the snippets of my code: From the JSP page (/showmanager is the urlpattern of the servlet): <form action="showmanager" method="post"> <h3>Enter name of the show: </h3> <input type="text" name="showname" value=""> <input type="hidden" name="task" value="addshow" /> <input type="button" value="Add Show"> </form> From the servlet (POST method): p rotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getParameter("task").equals("addshow")){ this.addShow(request.getParameter("showname")); response.sendRedirect("showmanager.jsp"); } } Method to add in database: protected boolean addShow(String showname){ try{ statement =con.prepareStatement("INSERT INTO showdb10(name) VALUES ('"+showname+"')"); if(statement.executeUpdate()>0){ return true; } } catch(Exception e) { try{ statement =con.prepareStatement("create table showdb10 (id int NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, date varchar(20),time varchar(20), b_total int, o_total int, b_avbl int, o_avbl int, b_price double(10,2), o_price double(10,2), seat_no varchar(20), transaction_id varchar(255), total_sales double(10,2), paymnt_artists double(10,2), paymnt_othr double(10,2), flag varchar(20), PRIMARY KEY(id))"); statement.executeUpdate(); statement =con.prepareStatement("INSERT INTO showdb10(name) VALUES ('"+showname+"')"); if(statement.executeUpdate()>0){ return true; } }catch(Exception e2){} } return false; }

    Read the article

  • Servlet xxx is not available

    - by hguser
    In the web.xml of my web app I have configed the server as following: The web.xml However when I request this servlet ,I got a error which tells me "Servlet SOS is not available",but I am sure this servlet do exist in the WEB-INFO/lib/sos.jar. And I have seen the initialization work under the servelt from the logs. I wonder why can not tomcat find the sevlet?

    Read the article

  • How do I correctly decode unicode parameters passed to a servlet

    - by Grant Wagner
    Suppose I have: <a href="http://www.yahoo.com/" target="_yahoo" title="Yahoo!&#8482;" onclick="return gateway(this);">Yahoo!</a> <script type="text/javascript"> function gateway(lnk) { window.open(SERVLET + '?external_link=' + encodeURIComponent(lnk.href) + '&external_target=' + encodeURIComponent(lnk.target) + '&external_title=' + encodeURIComponent(lnk.title)); return false; } </script> I have confirmed external_title gets encoded as Yahoo!%E2%84%A2 and passed to SERVLET. If in SERVLET I do: Writer writer = response.getWriter(); writer.write(request.getParameter("external_title")); I get Yahoo!â„¢ in the browser. If I manually switch the browser character encoding to UTF-8, it changes to Yahoo!TM (which is what I want). So I figured the encoding I was sending to the browser was wrong (it was Content-type: text/html; charset=ISO-8859-1). I changed SERVLET to: response.setContentType("text/html; charset=utf-8"); Writer writer = response.getWriter(); writer.write(request.getParameter("external_title")); Now the browser character encoding is UTF-8, but it outputs Yahoo!â?¢ and I can't get the browser to render the correct character at all. My question is: is there some combination of Content-type and/or new String(request.getParameter("external_title").getBytes(), "UTF-8"); and/or something else that will result in Yahoo!TM appearing in the SERVLET output?

    Read the article

  • Can't instantiate javax.servlet.ServletException

    - by Denis
    Hello, experts! I am trying to create instance of class javax.servlet.ServletException with following code public class MyTroubleViewer { public static void main(String[] args) { javax.servlet.ServletException servletException = new javax.servlet.ServletException("Hello"); System.out.println(servletException.getMessage()); } } But I get exception on creating: Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException ... Maven helps me with dependecies: <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <type>jar</type> <scope>compile</scope> </dependency> What am I doing wrong?

    Read the article

  • Java Servlet: getInitParameter not work in Service()

    - by Gabriele
    I've added some parameters in my web.xml config file, as follow: <context-param> <param-name>service1</param-name> <param-value>http://www.example.com/example2.html</param-value> </context-param> <context-param> <param-name>service2</param-name> <param-value>http://www.example.com/example2.html</param-value> </context-param> ... I try to get the parameter in my servlet, in particular in my service method: protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println(this.getServletContext().getInitParameter("service1")); ... but at runtime I have a NullPointerException... How can I get the parameter value included in web.xml? This is the stacktrace: GRAVE: Servlet.service() for servlet DispatcherServlet threw exception java.lang.NullPointerException at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:160) at it.servlethope.DispatcherServlet.service(DispatcherServlet.java:66) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source) DispatcherServlet.java:66 is the line where I try the getInitParameter()

    Read the article

  • Visualization api - hide data from displaying on browser using servlet

    - by Akku
    Generally the servlet extends httpservlet but in the code below the servlet extends DataSourceServlet and the page is created like this The text begins with google.visualization.Query.setResponse and ends with {c:[{v:'Bob'},{v:'Jane'}]}]}}); on the browser code: http://code.google.com/apis/visualization/documentation/dev/dsl_csv.html can you please guide me as to how can i make servlet page silent without giving the output on the browser.? so that i can directly call the javascript page for drawing the chart I want to integrate all the code but i am not able to remove this browser from coming. I am new to servlet please help

    Read the article

  • Error in jsp program calling servlet variable

    - by megala
    hi i created one webapplication project.It containe one servlet file jsp file. I created one string variable in servlet and assign some value like /* sampleservlet.java *******/ String s=" WELCOME" My constraints I want to display the string in my jsp file.so that i import the servlet file inj jsp and i created object as ---call--- jsp file contain following coding <%sampleservlet call ;% <%call.s% But it shows error how to solve this?

    Read the article

  • Can an applet communicate with an instance of a servlet

    - by mithun1538
    Hello everyone, I have an applet that communicates with a servlet using Http (Not sockets). Currently, each instance of the applet (i.e. when each applet is run by a different client on a different computer), all the instances communicate with the same servlet. What I want is that each instance of the applet communicate with different instances of the same servlet. Is this possible?

    Read the article

  • Not able to connect the DB from Servlet

    - by user1885127
    I have started jsp servlet application with Xampp Server, In which I have dbconnection.java and LoginValidator.java (servlet) files. I'm getting an error while trying to access the database from servlet (LoginValidator.java). It is getting the following error: Class Not found Exception : com.mysql.jdbc.Driver I have imported the mysql-connector-java-5.1.18-bin.jar. I have searched a lot but could not find the solution.

    Read the article

  • providing a java servlet with information

    - by tom
    Hi, i am new to servlets. I made a simple hello world programme that prints those famous 2 words to the screen when i access the page via a browser using http://localhost:8080/mypath/path... My question is now, how do i provide a servlet with information? Specifically considering the fact that my c# programme calculates a lookup value for a global system, then the "java" servlet processes that and returns a set of results. I have done the reverse thanks to help on here, regarding calling a returned string from the java servlet in c#. However i am not sure how i go about providing the servlet information. Do i pass it via the url? Thank you

    Read the article

  • How do I set up ServletForwardingController to intercept for jsp requests on weblogic

    - by dok
    My end goal is to be able to use the spring message tag with configured messageSource on a legacy app using a model-1 architecture. I've done this in tomcat with something like <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="WEB-INF/classes/bundle"/> </bean> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="*">myServletForwardingController</prop> </props> </property> </bean> <bean id="myServletForwardingController" name="/**/*.jsp" class="org.springframework.web.servlet.mvc.ServletForwardingController"> <property name="servletName" value="jsp"/> </bean> For weblogic I have <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basenames"> <list> <value>WEB-INF/i18n/bundle</value> </list> </property> </bean> <bean name="/**/*.jsp" class="org.springframework.web.servlet.mvc.ServletForwardingController"> <property name="servletName" value="JspServlet"/> </bean> But, no luck. I'm getting a StackOverflowError when I attempt to access a JSP. java.lang.StackOverflowError at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:338) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:259) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:35) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:338) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:259) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:35) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:683) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283) at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:394) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:309) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:533) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:266) at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:129) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) ...

    Read the article

  • Setting Environment Variable for Tomcat 6 Servlet

    - by amaevis
    I'm using Ubuntu's default installation of Tomcat 6. I'm deploying a ROOT.war, and trying to set an environment variable specific to it, i.e. accessible from System.getenv() in the Servlet.init(config). According to the docs (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html), I can specify this in a Context element in conf/Catalina/localhost/ROOT.xml. I've created that with these contents: <Context> <Environment name="FOO" value="bar" type="java.lang.String" override="false"/> </Context> And I've deployed the webapp as usual, i.e. to webapps/ROOT.war. Server.getenv("FOO") in the Servlet.init(config) still returns null. What am I missing?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >