View RSS Feed

My Java Tips

  1. Struts Controller

    by , 11-18-2011 at 06:13 PM (My Java Tips)
    Let us see how to configure the struts-config.xml file to map the request to some destination servlet or jsp file.


    The class org.apache.struts.action.ActionServlet is at the heart of the Struts Framework. It is the Controller part of the Struts Framework. ActionServlet is configured as Servlet in the web.xml file as shown in the following code.

    <!-- Standard Action Servlet Configuration (with debugging) -->
    Java Code:
    <servlet>
         <servlet-name>action</servlet-name>
    ...
  2. Sending files from Servlet

    by , 11-15-2011 at 06:35 PM (My Java Tips)
    In this post, I will present an example which will show how to move the selected file (drop down menu) form a servlet to another servlet which performs operations on the file.


    I have created 3 Javafiles namely:

    - HelloServlet(Servlet)
    - GetImg (Servlet)
    - ImgCompare (simpleJava class)

    HelloServlet contains a HTML form that has a dropdown menu. Menu contains 2 JPG files. You should have following images at the given path:

    C:\image1.jpg ...
    Categories
    Java EE