Converting JSP to servlet

Hi,
Can anyone show me how to convert my jsp to servlet. Then, from servlet to classes. Thanks.
cheers,

well, jsp pages are converted at run-time to servlets, e.g. if you are using tomcat as jsp engine, you will find the servlet java files somewhere under $TOMCAT_HOME/work/localhost. you can compile these java files to class files.
PS: There is a forum in here for JSP, and I would recommend that you post your questions there in the JSP forum (this one is about databases)

Similar Messages

  • Which part of container actually converts jsp to servlet

    hi all,
    although it's container's responsibility to convert
    jsp to servlet, but can any body tell me
    which part of that container is actually
    is responsible for this conversion
    thanx

    At least for Tomcat, the engine that converts a JSP into Java code is Jasper. Then the container has to take the Java code and compile that to a .class file. Once it has that, it keeps reusing the .class file whenever you make a JSP call.
    That's why first page access is often slow.
    A way to speed it up is to pre-compile your JSPs.
    %

  • Convert jsp to servlet

    is there any tool for translating a jsp code to be a servlet ?
    I know that basically this is what happened but
    this is my problem
    we are making a product that can be implemented in many application servers
    our problem,somtime , is that the jsp code should be changed for different application servers in order to work good
    this , in my opinion want happen if the code will be in servlet
    correct my if i am wrong
    Thanks Shlomi

    the server automatically creates this servlet. it's usually stored somewhere in the temporary directory that is specified in the context attribute javax.servlet.context.tempdir.
    File directory=(File) getServletContext().get.Attribute("javax.servlet.context.tempdir");
    But you are warned, the servlet's gonna be very complicated!!! And I don't know if it will help you with your problem...

  • Choice between JSP and Servlet

    I am new to JSP and Servlet. I know JSP container will convert JSP to servlet
    eventually. But in application development's standpoint, anything can be
    done in servlet can also be done in JSP? Some people told me we can
    use the combination of both in one application.
    My question is in what situation we use JSP alone, servlet alone, or
    combination of both??
    Please advise. Thanks!!

    Use a combination of both.
    Your Web application should have a single servlet that all HTTP requests are POSTed to. All the servlet does is act like a traffic cop: it figures out what the request is, delegates to other objects that do the work, and forward the result to the next JSP, whatever that is. It's called a front controller servlet.
    The JSPs should just be pure dynamic presentation. Everything displayed in the pages should have been generated by the servlet and its helper classes. No database queries, etc. Your JSPs will be a lot better off if you learn JSTL and eliminate all scriptlet code.
    Check out frameworks like Struts.

  • [MapViewer] MapClient.jsp to Servlet?

    Hi,
    Has anybody ever tried to convert the demo that comes with MapViewer into a servlet?
    Right now the MapClient.jsp demo is very slow here, and I hope to get some speed improvements with a servlet. I also think it's a little easier to add some extra functionallity with a servlet...
    So, has anybody done it?

    You may want to first find out what's slowing down the jsp client. Most likely its the database query time dominating the performance, in which case converting the jsp into servlet wont help much.
    you can change the logging level of MapViewer to "finest" and check the logs while doing a few zoom/pans from the client. see how much time is spent in loading the data from db and what's the percentage of that in the overall process.
    lj

  • I download itext  for convert jsp to PDF. How to set content type for PDF.

    I download itext for convert jsp to PDF. How to set content type for PDF. I try
    <%@ page contentType = "application/pdf;charset=TIS-620" %>
    , but the page does not PDF.
    Thank.

    PDF files are usually binary files, JSPs are not well-suited for binary content.
    (If you download the result of your JSP you'll see that it is not a valid PDF file; it will have probably a lot of whitespace and linefeeds, that will choke your PDF reader.). The first few characters must be
    "%PDF-" without whitespace.
    You can try using PDF files encoded as text - check if you can use text-encoded PDFs in iText.
    Try using a Servlet instead.

  • 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,
    Johnny

    I''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);

  • Converting Jsp file to Java file-Urgent

    hi,
    Is it possible to convert Jsp file to a Java file?
    Vijayalakshmi
    Chennai
    India

    Hi
    Put all the logic u have put in the JSP, into a servlet and compile it.
    Your webserver also does almost the same thing, it take the JSP and converts it into a servlet.
    Dave

  • What is the diff between jsp and servlet

    is thr any other difference betwwen jsp and servlet, tht: jsp is automatic generated servlet and jsp has different types of tag, due this we have write less amount of code.any other technically difference between these two?

    As you mentioned JSP automatically gets converted into a Servlet and then compiled. From the server's perspective other than the transformation process, there is no real difference.
    However, in coding there are some minor differences such as additional access to pre-defined variables and different syntax for some minor things such as imports and etc.
    Perhaps somebody else more knowledgeable can fill you in further.
    Hope that was helpful.

  • PL/SQL vs JSP vs Servlets

    We are in the stage of deciding which language to develop portlets. I lean towards JSP or servlets for the wide array of Java libraries we can use. I think the only advantage of PL/SQL is speed. Thanks.

    It depends. If your developers are mainly Java developers, you'll probably prefer building web portlets. But if you have a strong PL/SQL skill set you could choose the latter. Additionally, if you're developing content that is database intensive you may want to build PL/SQL portlets since they transact with the database faster. If you're going to aggregate content from various web sites, using web providers is preferable. It's a matter of choice based on your requirements and preferences.

  • Deploying a WAR file containing .jsp and servlets (also uses JNI)

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

  • How do I restrict access to JSP or servlet only through SSL Port

    Hi
    I want to restrict the access to few jsp and servlet only through SSL port,
    so how can I block the acces to those jsp and servlet through normal port??? We
    are using weblogic 5.1.
    Any help on this highly appreciated.
    Aruna

    Hi,
    To restrict access(56 bits or less). follow the below steps.
    1. Go to your Webserver instance ServerManager
    2. Click Preferences Tab ------> Encryption Preference
    ------> There disable "DES with 56 bit
    encryption and MD5 message authentication."
    for SSL 2.0 ciphers or SSL3.0 Ciphers. Which ever
    needed.
    3. Save and Restart the Webserver instance.
    The above steps are for 4.x version.
    Thanks,
    Daks.

  • Getting to next JSP from Servlet

    I am getting a 404 when I try to redirect from my servlet to an error page. The code that I am testing is....
    catch (SQLException es)
    LOG.error("Unexpected error in Login.createUser.Error
    message = " + es);
    session.setAttribute(Constants.MESSAGE, es.getMessage());
    session.setAttribute(Constants.ERROR_TITLE, "Login error: " + Constants.SQL_ERROR);
    resp.sendRedirect(Constants.ERROR_PATH);
    I have a compiled java class called Constants where the ERROR_PATH is defined as
    /** Constant name used in obtaining the path to the error page. */
    public static final String ERROR_PATH = "/Jsp/error.jsp";
    My JSP pages are located at the root...
    myapp
    ....Jsp
    ....WEB-INF
    ........classes
    My web.xml looks like this
    <servlet>
    <servlet-name>errorPage</servlet-name>
    <jsp-file>/Jsp/errorPage.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>error</servlet-name>
    <url-pattern>/Jsp/error.jsp</url-pattern>
    </servlet-mapping>
    Can anyone point me in the right direction....Thanks

    I tend to use a utility method called redirectToResource in particular to redirect from any servlet to any JSP :
    /** This method will still work when the server is configured to
    *   listen to  port 80 rather than port 8080 (default in Tomcat)
    public void redirectToResource (HttpServletRequest req,
                                     HttpServletResponse resp,
                                  String resourceName)
                         throws ServletException, IOException
       int serverPort    = req.getServerPort();
       String scheme     = req.getScheme();
       String serverName = req.getServerName();
       StringBuffer urlBuffer = new StringBuffer(40);
       urlBuffer.append(scheme + "://" + serverName);
       urlBuffer.append(":" + serverPort);
       urlBuffer.append(resourceName);
        String location = resp.encodeRedirectURL(urlBuffer.toString());
        resp.sendRedirect(location);
    }

  • Need help in JSP and Servlets

    Hi friends,
    [please forgive me if i am posting this in the wrong forum, all seems same to a fresher]
    Now, to my problem..i need a suggestion, a way or a method to implement the following!
    I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task?
    Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSP
    Thanks in adavance

    arun_ramachandran wrote:
    [please forgive me if i am posting this in the wrong forum, all seems same to a fresher]Then you should learn to be more observant - after all, we have JSP and Servlet fora, further down the list. :)
    I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task? You can store the data in your session object. You can even use JavaBeans and the jsp:usebean tag.
    [http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html]
    Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSPA wise approach - I wish more prople woiuld be as thoughtful.

  • How can i upload a image file to server by using jsp or servlet.

    Hi,
    I m gurumoorthy. how can i upload a image file to server by using jsp or servlet without using third party API. pls anyone send me atleast outline of the source code.
    Pls send me anyone.
    Regards,
    Gurumoorthy.

    I'm not an applet programmer so I can't give you much advice there.
    If you want to stream the file from the server before it's entirely uploaded, then I don't believe you can treat it like a normal file. If you're just wanting to throw it up there and then listen to it, then you can treat it like a normal file.
    But again, I'm not entirely certain. You might be able to stream the start of the file from the server while you're still uploading the end of it, but it probably depends on what method you're using to do the transfer.

Maybe you are looking for

  • S_ALR_87012168 : specific layout

    Hi, I look for a specific layout in Tcode S_ALR_87012168 : Due date analysis for open items i want to display in one list all the selected customers with thier daily intervals. Please is it possible to make this layout ? if yes, How ? Regards.

  • Role created in ERM is not appearing in CUP request for assignment-GRC 10.0

    Hi, We are on GRC 10.0 - SP5 We have created a role in ERM and it was succesfully created in backend system. However when we tried to assign the same role using CUP request - the role is not appearing. 1) Do we need to upload roles for CUP  in GRC 10

  • Trying to pair my iphone 4 to my imac

    so i just bought an imac today and out of curiosity i decided to try to pair my iphone 4 to the imac. it registers and says that its paired but will not connect...the blue tooth sharing is on on the imac and bluetooth is on on the iphone. if i to con

  • XRaid Performance Sub-Par for HD Video

    Hey Guys....I'm testing out my fully populated XRaid with AJA's Kona 2 System Checker. Starts out great, writing at around 272 Mbps. But then after a few seconds, it drops off to around 60 Mbps. Read times are even slower at around 30 Mbps. Here are

  • Where is spell check and insert signature

    ANGRY that when I access my company e-mail through Outlook Web Access, there is no ability to spell check and no way to insert signature. So....do I have to check my e-mail on a PC to get these features...say it is not so.