- 
        1. Re: I want a simple example of JSP or servletjoelvogt Aug 19, 2002 2:20 AM (in response to sheldon)step 1, write a j2ee app 
 step 2, put it in jboss/deploy
 If you want a simple app, make a directory foo.war in jboss/deploy and put a jsp foo.jsp inside.
 Your foo.jsp can have the following text :
 foo
 then go to http://localhost:8080/foo/foo.jsp
 and you will see the message foo.
 I can include these files as an attachement if you don't want to write the foo.jsp yourself.
- 
        2. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:26 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        3. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:27 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        4. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:28 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        5. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:29 AM (in response to sheldon)Hi, Could you give me the every source code. Because I do not know how to write it. Thank you very much.Appreciate for your response and help 
- 
        6. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:30 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        7. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:31 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        8. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:41 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        9. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:41 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        10. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:42 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        11. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:42 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        12. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 10:42 AM (in response to sheldon)Hi, Could you give me the every source code. Because I don't know how to write it. Thank you very much.Appreciate for your response and help 
- 
        13. Re: I want a simple example of JSP or servletsheldon Aug 20, 2002 11:13 AM (in response to sheldon)Hi, 
 Could you give the source code of every file. I don't know how to write it.
 Appreciate for your response and help
- 
        14. Re: I want a simple example of JSP or servlettorreblanca Aug 20, 2002 3:01 PM (in response to sheldon)Sheldon, 
 Here is the procedure for JSPs :
 1. Write the JSP
 Example (uno.jsp) :
 <%@ page import="java.text.*,
 java.util.*"%>
 <%
 Date d = new Date();
 String hoy = DateFormat.getDateInstance().format(d);
 %>
 La Fecha de hoy es :
 <%= hoy %>
 2. Create a WAR file with JSP file. Use the following command :
 jar -cvfM uno.war uno.jsp
 3. Create an application.xml file in META-INF directory. You need set the correct values in <web-uri> tag and <context-root> tag.
 web-uri = WAR name file
 Example (application.xml):
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <display-name>uno</display-name>
 <web-uri>uno.war</web-uri>
 <context-root>/uno</context-root>
 4. Create a EAR file with WAR file and application.xml file. Use the following command :
 jar -cvfM uno.ear uno.war META-INF
 5. Copy this EAR file in %JBOSS_HOME%\server\default\deploy
 6. Run the JBoss-Tomcat server.
 7. Test the JSP. Use the following URL:
 http://[IP ADDRESS SERVER]:8080/uno/uno.jsp
 The first time is slow because JBoss-Tomcat compiles the JSP file but the next time is fast.
 HERE IS THE PROCEDURE FOR SERVLETS :
 1. Write your servlet. For example
 Dos.java
 package com.servlet;
 import java.io.*;
 import javax.servlet.*;
 import javax.servlet.http.*;
 public class Dos extends HttpServlet {
 public void doGet(HttpServletRequest request,
 HttpServletResponse response)
 throws ServletException, IOException {
 PrintWriter out = response.getWriter();
 out.println("Hello World");
 }
 }
 2. Compile your servlet. Use the following command :
 javac -classpath d:\jboss-3.0.1_Tomcat-4.0.4\catalina\common\lib\servlet.jar Dos.java
 3. Create a WEB-INF directory.
 4. Create a classes directory in WEB-INF directory and copy Dos.class.
 WEB-INF (Subdirectory)
 I
 I
 classes (Subdirectory) ---
 I
 I
 com (subdirectory)----
 I
 I
 servlet (subdirectory)
 I
 I
 Dos.class (Java Class)
 5. Create a web.xml file in WEB-INF directory.
 For example:
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE web-app
 PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
 <servlet-name>Dos</servlet-name>
 <servlet-class>com.servlet.Dos</servlet-class>
 </web-app>
 6. Create a META-INF directory.
 7. Create an application.xml file in META-INF directory.
 For example:
 application.xml
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <display-name>dos</display-name>
 <web-uri>dos.war</web-uri>
 <context-root>/dos</context-root>
 8. Create a WAR file. Use the following command :
 jar -cvfM dos.war WEB-INF
 9. Create a EAR file. Use the following command :
 jar -cvfM dos.ear dos.war META-INF
 10. Copy the EAR file in %JBOSS_HOME%\server\default\deploy
 11. Run the JBoss-Tomcat server.
 12. Test the Servlet. Use the following URL:
 http://[IP ADDRESS SERVER]:8080/dos/servlet/Dos
 Regards
 Javier
 
     
    