???JBoss????? - PowerPoint PPT Presentation

About This Presentation
Title:

???JBoss?????

Description:

JBoss Step 1 J2SE JDK 5.O http://java.sun.com/j2se/1.5.0/download.jsp JBoss (.zip ) http ... – PowerPoint PPT presentation

Number of Views:130
Avg rating:3.0/5.0
Slides: 15
Provided by: ppb2
Category:
Tags: jboss

less

Transcript and Presenter's Notes

Title: ???JBoss?????


1
???JBoss?????
2
??Step 1
  • ??J2SE JDK 5.O???
  • http//java.sun.com/j2se/1.5.0/download.jsp
  • ??JBoss???? (.zip?)
  • http//sourceforge.net/project/showfiles.php?grou
    p_id22866package_id16942release_id365509

3
??Step 2
  • ????????
  • JBOSS_HOME C\jboss-4.0.3SP1
  • JAVA_HMOE C\Program Files\Java\jdk1.5.0_06
  • (??????????,????????)
  • PATH JAVA_HOME\bin
  • CLASSPATH .JAVA_HOME\lib
  • ???????

4
??Step 3
  • ?C\jboss-4.0.3SP1\bin??????run.bat????JBoss,?????
    ???

5
??Step 4
  • ?????,?? http//localhost8080/
  • ?????????JBoss?????

6
??Step 5
  • ?????JBoss??????CtrlC?

7
??Step 1
  • ????????,???TestRoot,??Test?????????WEB-INF,
    ??WEB-INF????????classes??????????C\TestRoot\WEB
    -INF\classes
  • ??WEB-INF?classes???????,???????,??????????

8
??Step 2
  • ?????servlet??,??? .java,??????.class??
  • ?????????????????
  • PATH JBOSS_HOME\server\default\lib\javax.serv
    let.jar
  • ????import servlet??????

9
??Step 2 (servlet??.)
??MyFirstServlet.class??test?????
  • package test
  • import java.io.
  • import javax.servlet.
  • import javax.servlet.http.
  • public class MyFirstServlet extends HttpServlet
  • public void doGet(HttpServletRequest request,
  • HttpServletResponse response)
  • throws IOException,
    ServletException
  • response.setContentType("text/html")
  • PrintWriter out response.getWriter()
  • out.println("lthtmlgt")
  • out.println("ltbodygt")
  • out.println("ltheadgt")
  • out.println("lttitlegtServlet
    Exerciselt/titlegt")
  • out.println("lt/headgt")
  • out.println("ltbodygt")
  • out.println("lth2gtThis is my first
    Servlet!lt/h2gt")

10
??Step 3
  • ???web.xml (?????),???
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltweb-app xmlns"http//java.sun.com/xml/ns/j2ee"
  • xmlnsxsi"http//www.w3.org/2001/XMLSchema-ins
    tance"
  • xsischemaLocation"http//java.sun.com/xml/ns/
    j2eehttp//java.sun.com/xml/ns/j2ee/web-app_2_4.xs
    d"
  • version"2.4"gt
  • ltservletgt
  • ltservlet-namegtfirstTestlt/servlet-namegt
  • ltservlet-classgttest.MyFirstServletlt/servlet-clas
    sgt
  • lt/servletgt
  • ltservlet-mappinggt
  • ltservlet-namegtfirstTestlt/servlet-namegt
  • lturl-patterngt/Test.dolt/url-patterngt
  • lt/servlet-mappinggt
  • lt/web-appgt

???,????
?????
???????
???servlet???,??package?????????
?????????????,??,???????/
11
??Step 4
  • ?web.xml??WEB-INF?????test\MyFirstServlet.class??c
    lasses??????
  • ??????
  • C\TestRoot
  • -WEB-INF
  • -classes
  • -test
  • -MyFirstServlet.class
  • -web.xml

12
??Step 5
  • ?????.war?,????????,??????
  • ???C\TestRoot\???????TestRoot.war,?.war????C\jbo
    ss-4.0.3SP1\server\default\deploy\??

13
??Step 6
  • ????JBoss?
  • ?????,??http//localhost8080/TestRoot/Test.do

14
  • ?????????????ST507AAJC
  • ??mailg942820_at_thu.edu.tw
Write a Comment
User Comments (0)
About PowerShow.com