Doubt in Generic Servlet and Http Servlet

Hi,
I studied Genaric Servlet does not support state and session mengement and where as Http Servlet supports state and session mengement.
Why Genaric Servlet does not support state and session mengement ?
Can any one plz tell me reasons.

GenericServlet is pretty much the most basic Java application that you can run server-side. It doesn't support much of anything except for the basic life cycle management and a couple other things. Go to Dictionary.com and lookup the word Generic. It's used a lot in software development. Go to http://java.sun.com/j2ee/1.4/docs/api/index.html to read more on the GenericServlet class.
BalusC, because a thread hasn't been active in awhile doesn't mean it's dead. If it were dead it would not be editable. Moreover, the question was never answered (adequately).
Edited by: wpafbuser1 on Jan 3, 2008 3:33 PM

Similar Messages

  • Problems Compiling javax.servlet and javax.servlet.http

    When I try to compile a program that imports both javax.servlet and javax.servlet.http, the compiler keeps telling me that "package javax.servlet does not exist"... I have place the javax.servlet packages in the src.zip and in the src folder but i dont understand why the compiler isnt picking them up. Maybe I did something wrong ... could someone help please

    Try to compile vith the option "-classpath /your/path/to/servlet.jar"

  • Hi,what is servlet and http tunneling .

    hi,what is servlet and http tunneling .and at which scenario those two are implemented by us .i am expecting good answer from u is at which scenario those we use.please help me in this.

    HttpTunnelling is simply acting as a proxy. You will receive a web request at your Servlet, use either HttpClient or the standard java.net classes to initiate a new connection to the target web server. Then you will pipe all request bytes through your server to the target server and reverse the process, piping all response bytes from the target server to the client. You are in effect acting as a tunnel between the browser and the target server. This is also known as proxying.
    - Saish

  • Help With Integrating Servlet and JSP Page?

    Hello There
    --i made jsp page that contain name and description fields and add button
    --and i made servlet that contain the code to insert name and description in the database
    --and i want to make that when the user hit the add button
    -->the entered name and description is sent to the servlet
    and the servlet sent them to database?
    here's what i 've done:
    the jsp code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="jpage.jsp" method="get">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="submit" value="Add" name="button" />
           </h3>
       </form>
        </body>
    </html:html>the servlet code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    class NewServlet1 extends HttpServlet{
         Connection conn;
         private ServletConfig config;
    public void init(ServletConfig config)
      throws ServletException{
         this.config=config;
    public void service (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
       HttpSession session = req.getSession(true);
       res.setContentType("text/html");
    try{
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
         PreparedStatement ps;
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, "aa");
          ps.setString (3, "bb");
          ps.executeUpdate();
          ps.close();
          conn.close();
      }catch(Exception e){ e.getMessage();}
      public void destroy(){}
    }

    The JSP Code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="actionServlet.do?action=Additem" method="*post*">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="button" value="Submit">
           </h3>
       </form>
        </body>
    </html:html>The Servlet Code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    public class NewServlet1 extends HttpServlet implements SingleThreadModel {
        public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
            doPost(request,response);
        public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
              String action = request.getParameter("action"); // action = "Additem"
              if (action.equals("Additem")) {
                   String name = request.getParameter("name");
                   String description = request.getParameter("description");
                         RequestDispatcher reqDisp = null;
                   try{
                  Connection conn;
                  PreparedStatement ps;
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, name);
          ps.setString (3, description);
          ps.executeUpdate();
          ps.close();
          conn.close();
          reqDisp= request.getRequestDispatcher("./index.jsp");
          reqDisp.forward(request, response);
                   catch (Exception ex){
                        System.out.println("Error: "+ ex);
    }The web.xml code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>2</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>2</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
            </servlet>
        <servlet>
            <servlet-name>NewServlet1</servlet-name>
            <servlet-class>NewServlet1</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>NewServlet1</servlet-name>
            <url-pattern>/NewServlet1</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
            </welcome-file-list>
            <servlet>
         <servlet-name>actionServlet</servlet-name>
         <servlet-class>com.test.servlet.NewServlet1</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>actionServlet</servlet-name>
         <url-pattern>*.do</url-pattern>
    </servlet-mapping>
        </web-app>

  • How can i send xml file with a http servlet request

    Hi
    Please tell me how can I send a xml file into http servlet request.
    I have a servlet(action) java file.From this servlet I have generate a xml file. Now I need to send that xml file to another servlet with http servlet request object.
    Dave.

    When you say you have generated an XML file what do you mean?
    Is it a file stored on disk? Then pass the file path as a string to the servlet.
    Is it stored in memory as an object? The pass a reference to the object to the servlet.
    Or are you asking how to communicate between servlets?
    Look in the JavaDocs for the RequestDispatcher class. You can use this class to forward the request to another servlet. Data can be passes using the RequestDispatcher by storing it as attributes using the request getAttribute and setAttribute methods. Also described in the JavaDOcs.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html

  • How to compile and execute servlet file in j2ee

    In j2ee server when iam compiling servet i am getting error messages like package javax.servlet,and javax.servlet.http does not exist like that.
    i hsve set path like this.and i gave path for j2sdk .
    set CPATH=.;%J2EE_HOME%\lib\j2ee.jar
    javac -classpath %CPATH% AdderServlet.java
    can anybody tell me where to place
    servlet and how to compile it.
    Thank u,
    Renuga

    Make sure that '%J2EE_HOME%\lib\j2ee.jar' is existing. Where is your J2EE_HOME pointing to?
    The best thing I can suggest is, create your own bat file to compile the servlets. Like this,
    Save the lines below as "MyCompiler.bat" file.
    @echo off
    set JDK_HOME=<path to you jdk home upto bin directory>
    set J2EE_HOME=<path to you je22 home>
    set CLASSPATH=.;%J2EE_HOME%\lib\j2ee.jar
    %JDK_HOME%\javac %1
    Use the command,
    MyCompiler AdderServlet.java
    You can improve this MyCompiler.bat further, can add additional jar files to the classpath whenever you want. You can put this bat file in System's path, so that you can invoke it just by the name (MyCompiler) without giving the full path to it (like C:\mydir\MyCompiler).
    Hope this helps.
    Sudha

  • Generic Online Store using Servlets or jsps

    Ok first of im really new to Java and im in an advanced course for software development. My current project is to creat an HTML frontside of the simple store. And if this is in the wrong forum plesae sugest what forum to post it in, Im new to the forum as well.
    here's a picture of my frontside.
    http://i7.photobucket.com/albums/y291/dayv2005/page.jpg
    Im using netBeans 5.0 and im starting with creating an item bean for the items on my page. There im getting pulling the parameters from the form on my page.
    Now i want to creat a basic store from that and creat a session and a shopping cart for my project.
    I was wondering if ne one could help me out with some advice or even some tutorials for what im trying to do. Tutorials seems to help me out a lot and dont worry im not trying to ask someone to do the project for me but ne help is apprecieated thanks in advance.

    Ok let me restate this that pet store wasnt the same idea i was going for.
    Ok i have forms on my web page i named the forms textbox and add to cart buttons. Now what i want them to do is some how submit to my servlet and my servlet will have a shopping cart session to keep track of what they bought and stuff like that. Thats more or so what im look at just somehting basic useing servlets i think im gonna stay away from jsps for now. Just somehting basic with no DB or JSP just html and servlets.
    how about can anyone help with that

  • J2se vs j2ee javax.servlet.* & javax.servlet.HTTPServlet

    Hi,
    I guess I have a basic question....It is in j2se 1.4.2 API's one does not have the package javax.servlet.* or javax.servlet.HttpServer package/classes.How does one get to compile the java source file if it imports javax.servlet.* and javax.servlet.HttpServlet.,both of these are present in the j2ee API's.Help would be greatly appreciated.
    Thanks
    AS

    Yup, pretty basic.
    You're right - the javax.servlet and
    javax.servlet.http packages are not part of the J2SE.
    However, they are part of every servlet/JSP engine
    you can find, including Tomcat and Sun ONE J2EE app.
    Look for a j2ee.jar or servlet.jar (or servlet-api.jar
    if you're using Tomcat 5.0.x) and you'll find those
    classes. Once you locate the proper JAR, all you have
    to do is make sure it's in your CLASSPATH when you
    compile and run:
    javac -classpath .;/full/path/to/servlet.jar *.java
    MODThanks for the reply.So if we compile it we will get compile errors right?,without the appropriate classpath settings.Got you.
    AS

  • Cannot Import javax.servlet.* and javax.servlet.http.*

    Hello,
    I am a University Student and now doing a project using Servlet and JSP
    I have installed WinXP and Tomcat 5.0 on my computer
    When I compile the servlet , there are error messages "package javax.servlet does not exist" and "package javax.servlet.http does not exist" coming out.
    I have set the classpath already
    i.e. %CATALINA_HOME%\common\lib\servlet-api.jar;%CATALINA_HOME%\common\lib\jsp-api.jar
    ( Of course "%CATALINA_HOME%" = my folder that install the Tomcat )
    Can Anybody Explain what is happening and suggest a solution to me?
    Please give a hand.

    When you ran that command, what happened? Let javac.exe tell you the right answer.
    I'd advise two things:
    (1) Installing any s'ware in a directory whose name contains spaces (e.g., "Apache Software Foundation" or "Tomcat 5.0") is a very bad idea, IMO. I'd reinstall to a new directory.
    (2) Your HelloServlet.java servlet probably doesn't have a package statement in it. Tomcat 5.0 won't play nicely with servlets or beans that aren't in packages. I'd add one and use the -d . option on javac.exe to make sure it created the package directory structure for me.

  • Communication beween an http client a servlet and a socket server

    Hello I&#8217;m developing an application that needs a client to communicate with a servlet using Http and then the servlet needs to connect to a server using sockets.
    The client will send an image to the servlet and then the servlet will send that image to the server.
    Everything works OK except when I try to send the data from the servlet to the server. It seems that there is no indication of when the outputstream has reached its end. So when trying to do this at the server side:
    BufferedInputStream inFromClient =
                  new BufferedInputStream(serverSocket.getInputStream());
    int inp=0;
    while ( (inp=inFromClient.read())!=-1 )
             //do smth
    }The server will block at the read() method.
    If I close the connection from the servlet using the close() method of a print stream everything will work fine
    but I don't want to do that because I want the server to send a message back at the servlet.
    I don't know if I make any sense but I'm new to servlets and Java as well.
    Thanks in advance and if there something that you don't understand please let me know.

    I'm not quite sure what you mean. I have tried to do the same in the following piece of code and it worked fine. The only difference is that here the data is read from a file but I still send it as raw data(bytes).
    import java.io.*;
    import java.net.*;
    public class Client
        private String path="c:\\img0049.jpg";
        private static void sendImage(Socket client,BufferedOutputStream toServer)
             BufferedInputStream readFile=null;        
             int inp=0;        
             try
                  readFile = new BufferedInputStream( new FileInputStream(path) );
                  while ( (inp=readFile.read())!=-1 )
                        toServer.write(inp);
              catch (IOException e)
                   e.printStackTrace();
              finally
                if (readFile != null)
                     try {
                   readFile.close();
              } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                     //client.close();
        public static void main(String args[]) throws Exception {
            // connect through localhost to the same port that the server is listening to
            Socket clientSocket = new Socket("127.0.0.1", 4322);
            BufferedOutputStream outToServer =
                    new BufferedOutputStream(clientSocket.getOutputStream());             
                sendImage(clientSocket,outToServer);              
            outToServer.close();
            clientSocket.close();
        }// main   
    }// classIn the server side I'm just reading it with something like that
    try {
                    BufferedOutputStream out =
                         new BufferedOutputStream( new FileOutputStream("c:\\out.jpg"));
                    int inp=0;
                    while ( (inp=inFromClient.read())!=-1 )
                         out.write(inp);
                    out.close(); //close will also flush
    //.....rest of codeNow here is the servlet code of the application that I'm discussing (the servlet has already received the data from the client using the Htpp protocol. I know it has through debugging).
    I'm guessing that the servlet is storing my data in the BufferedInputStream so then I'm trying to read from there and send it to the server
    public void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException
              /* Get input stream from mobile client: Servlet<-- Client */
              ServletInputStream inputFromClient = request.getInputStream();
              BufferedInputStream bufInputFromClient = new BufferedInputStream(inputFromClient);
              /*Create socket and get output stream in order to communicate with
               * Server: Server<-- Servlet */
              Socket clientSocket = new Socket("127.0.0.1",4322);
              OutputStream outputToServer = new PrintStream(
                        clientSocket.getOutputStream());
              /* Empty buffer and send data to output stream */
              int inp=0;          
                         while ( (inp=bufInputFromClient.read())!=-1 )
                          outputToServer.write(inp);
                        outputToServer.flush();                   
                       //outputToServer.close(); //If I use this the server will know that the stream has ended                   At the server I'm using again the 2nd piece of code I posted above.
    That's it I hope I'm not confusing you.Thanks

  • How get xml-data at servlet by http and parse it?

    hello! please help me who can, i have very urgent task but not much skilful to deal with work in web. is anywhere source code or similar example of task to get xml-data at servlet by http and parse it . thank you in advance

    here a basic code that reads and parses an remote xml file:
    import java.io.IOException;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    public class SAXParserExample extends DefaultHandler {
         StringBuffer buffer;
         String urlString = "http://nds.nokia.com/uaprof/NN95_8GB-1r100.xml";
         public SAXParserExample() {
         public void runExample() {
              parseDocument();
         private void parseDocument() {
              // get a factory
              SAXParserFactory spf = SAXParserFactory.newInstance();
              try {
                   // get a new instance of parser
                   SAXParser sp = spf.newSAXParser();
                   URL url = new URL(urlString);
                   HttpURLConnection httpSource = (HttpURLConnection) url.openConnection();
                   // parse the file and also register this class for call backs
                   sp.parse(httpSource.getInputStream(), this);
              } catch (SAXException se) {
                   se.printStackTrace();
              } catch (ParserConfigurationException pce) {
                   pce.printStackTrace();
              } catch (IOException ie) {
                   ie.printStackTrace();
         // Event Handlers
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
              System.out.println("+++ start of element: " + qName);
              buffer = new StringBuffer();
         public void characters(char[] ch, int start, int length) throws SAXException {
              buffer.append(ch, start, length);
         public void endElement(String uri, String localName, String qName) throws SAXException {
              System.out.println(buffer.toString());
              System.out.println("+++ end of element " + qName);
         public static void main(String[] args) {
              SAXParserExample spe = new SAXParserExample();
              spe.runExample();
    }you have only to change the urlString and adapt to your needs.
    hope it helps

  • Servlet doPost() method and "HTTP Status 404 - /HelloPost" error

    hi all
    i've a problem with doPost(...) method. i use Tomcat4.1 version and in root folder i store Form.html where i use a doGet() method and in WEB-INI>>classes i store Hello.class file for doGet() method. it works normally. but when i write a Form1.html for doPost() method with "<FORM METHOD=POST ACTION="/HelloPost">" line and store as same folder as Form.html and HelloPost.class in WEB-INI>>classes folder. its not working and showing a error
    "HTTP Status 404 - /HelloPost"
    error type =Status error.
    message=/HelloPost
    description =The requested resource (/HelloPost) is not available
    if anyone of u know what the problem is.. then plz inform me... it will help me a lot to learn servlet.
    thnx a lot
    Arif

    Your post is very hard to read. The next time try to be more accurate.
    i store Form.html where i use a doGet() method That makes no sense.
    I think you have a form with method="GET"
    and in WEB-INI>>classes i store Hello.class file for doGet() method. you have a Servlet called Hello which handles doGet(Request, Response) calls and whose class file you've put into WEB-INF/classes
    but when i write a Form1.html for doPost() method with "<FORM METHOD=POST ACTION="/HelloPost">" line and store as same folder as Form.html and HelloPost.class in WEB-INI>>classes folderIt's not enough to put a class file which has the same name as the action of your form into the folder WEB-INF/classes. The class must implement the (Http)Servlet Interface and you have to configure the servlet in the web.xml file.
    From where did you get the working Hello example code ?
    Look at the Chapter 11: Java Servlet Technology of the J2EE 1.4 Tutorial to learn how to write Servlets.

  • Difference between servlet and filter

    difference between servlet and filter

    Its not a secret you know; if you just read a little about what they are used for, you answer your own question plus many more to follow.
    Servlet: http://en.wikipedia.org/wiki/Java_Servlet
    Filter: http://www.oracle.com/technetwork/java/filters-137243.html

  • Form Authentication Servlet  and MD5

    Dear forum,
    I have the following servlet to authenticate a user via form. If you go to the root url you get the login html and the authentication works fine but if the user knows the url of a specific html just by typing the url gives access to the page without going through the authentication. The website is composed of htmls and servlets. How can I force the authentication for the htmls and the servlets. I included at the bottom how I added the Login servlet to the web.xml. I suspect that the servlet definition in the web.xml is the problem.
    Also I would like to use MD5 encryption, would someone suggest how this can be accomplished.
    Thanks.
    This is the code:
    import java.io.*;
    import java.util.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.sql.*;
    import javax.sql.*;
    public class LoginServlet extends HttpServlet {
      public void doPost (
         HttpServletRequest     request,
         HttpServletResponse     response
        ) throws ServletException, IOException
      String item = request.getParameter("account");  
      doGet(request,response);
      public void doGet (
         HttpServletRequest     request,
         HttpServletResponse     response
        ) throws ServletException, IOException
       HttpSession session = request.getSession(true);
       PrintWriter out = response.getWriter();
         try {
              String driverName="sun.jdbc.odbc.JdbcOdbcDriver";
              String dbUrl="jdbc:odbc:Virtual_Library_DB";
              Class.forName(driverName);
              Connection db =DriverManager.getConnection(dbUrl,"","");
              if ((session.getAttribute("user") == null) || (!session.getAttribute("ip").equals(request.getRemoteAddr()))){
                   PreparedStatement pStmt = db.prepareStatement("SELECT * FROM Login WHERE Login.account =? AND Login.password=? ");
                   pStmt.setString(1, request.getParameter("account"));
                   pStmt.setString(2, request.getParameter("password"));
                            pStmt.setString(3, request.getParameter("level"));
                   ResultSet rs = pStmt.executeQuery();
                    System.out.println("hello");
                   if(!rs.next()){
                        System.out.println("Account is not valid.");
                        request.setAttribute("msg", "Account is not valid.");
                        RequestDispatcher rd = request.getRequestDispatcher("LoginInvalid.html");
                        rd.forward(request, response);
                   else do {
                        int id = rs.getInt(1);
                        String account = rs.getString(2);
                        session.setAttribute("user", new Integer(id));
                        session.setAttribute("account", account);
                        session.setAttribute("ip", request.getRemoteAddr());
                        System.out.println("User " + session.getAttribute("user") +" has logged on.");
                        request.setAttribute("msg", "User has logged on.");
                        RequestDispatcher rd = request.getRequestDispatcher("index.html");
                        rd.forward(request, response);
                   } while(rs.next());
                   rs.close();
              else {
                   System.out.println("User has already logged on.");
                        request.setAttribute("msg", "User has already logged on.");
                        RequestDispatcher rd = request.getRequestDispatcher("index.html");
                        rd.forward(request, response);
              db.close();
         catch(Exception exp){
              System.out.println("Exception: "+ exp);
       out.close();
    web.xml
    <servlet>
        <servlet-name>LoginServlet</servlet-name>
        <servlet-class>LoginServlet</servlet-class>
      </servlet>
    <servlet-mapping>
        <servlet-name>LoginServlet</servlet-name>
        <url-pattern>/LoginServlet</url-pattern>
      </servlet-mapping>

    Check the session in the servlets that are allowed only for logged-in users.
    public class ServletUtils
        public static boolean checkLogin(HttpServletRequest request, HttpServletResponse response)
            HttpSession session = request.getSession(false); // false = don't create a new session if not logged in
            if (session != null)
                return true;
            Logging.log("tried to access page without login, redirecting to login");
            ...redirect to login.html...
            return false;
        // At the start of your doGet()'s:
        if (!checkLogin(request, response))
            return;Do you really need static documents to be authenticated? dot.gif's and all? Someone can make a zip file of them anyway and post it to their own web site or Kazaa.
    If you have a couple of html pages you want authenticated, easiest is to write them as servlets (+ maybe JSP's) and do the login check there.
    Ok, let's say you have ...what, an "image database" (heh) that you want available to logged-in users only. Write a servlet that serves those pages. That servlet checks the session, and then copies the appropriate file to the user (remember to set content type; consider caching the files if hit rate is very high.) The servlet would be called like /images/show?id=gerbilsex/closeup.gif to fetch the named file. Put the files outside the web server's document directory so they are not accessible except through the servlet. Perform strict checks on the file name to disallow nastiness like id=../../../etc/passwd. A similar database solution is also possible. Another variant is to map a servlet to a "virtual directory name" and get the actual file name from the URL path -- similar to the ?id= solution, except the URLs don't have parameters.
    About md5: md5 isn't an encryption algorithm, it is a hash algorithm (aka "message digest" or "fingerprint"). It can't be decrypted. What do you really want to accomplish - encryption or hashing?

  • How can I have a default servlet and an index.html?

    Hi,
    I writing a small webapp to test/understand the 2.2 Servlet Spec. I am deploying this as a WAR to Orion, Tomcat and Silverstream.
    The app's name is: "myapp"
    My application has an index.html, which is listed as the sole welcome-file in the welcome-file-list element in the app's web.xml.
    The interesting thing is that, after adding a default Servlet (<url-pattern>/</url-pattern>), I can no longer access the app's index.html either implicitly or explicitly:
    1. Implicit:
    - http://localhost/myapp
    - http://localhost/myapp/
    2. Explicit:
    - http://localhost/myapp/index.html
    - http://localhost/myapp/index.html/
    All of these invoke the Default Servlet in all 3 app servers.
    Question: How can I have both a default Servlet and an index page?
    Thanks in advance.
    Miles

    you can define it in the web.xml file
    look at the dtd, element "welcome-file-list"

Maybe you are looking for

  • Firefox is not working after restart. Need to reinstall every time I am starting PC.

    Hello everyone, I was happily using Firefox untill few days ago. Since then Firefox takes about five minutes to start (you cant see in taskbar or Application in task manager, just in Processes in task manager). When it finaly opens the first window i

  • Do converted docs remain in cyberspace?

    2/4/15                          I just bought Adobe Reader XI Created Wednesday, January 21, 2015, 5:25:38 PM to allow me to convert PDF's to "Word" and "Excel".                         It is a valuable function for me, and thank you for it.         

  • Excise paid to capture in sap

    Hi expert I have paid some excise duty from  bank to government . i want to know the process , one should must carry out in SAP with Tcode Regard Nabil

  • Re-using a deleted object name

    Using 7.01.230 on a Windows 7 professional machine An annoyance at best but I was wondering why I can't re-use a name for an object or a group if the previous object or group has been deleted from the project. Sometimes, clients want a new/update ima

  • Create a reservation without a purchase order

    Hi all, I try to create a reservation without a purchase order for material T-RN133, and then i got a message, " Order 800040 is flagged for deletion". Then i tried to create another reservation, but still got the same error message. THe movement typ