-
1. Re: how to display a jsp page using jboss under linux?
rbottoms Mar 19, 2004 11:59 PM (in response to kondetisree)Create directories
c:\app
c:\app\META-INF
c:\app\code
c:\app\code\META-INF
Create a file c:\app\code\META-INF\web.xml
This is web.xml:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
</web-app>
Create a file c:\app\code\index.jsp
This index.jsp:
<%=out.println("Welcome to JBoss World "); %>
cd c:\app\code\
Issue the command:
jar -cvf c:\app\indexdv.war META-INF/*.xml *.jsp
cd c:\app
Create file c:\app\META-INF\application.xml
This is application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<display-name>index</display-name>
<web-uri>indexdv.war</web-uri>
<context-root>/</context-root>
Issue the command:
jar -cvf indexdv.ear META-INF/*.xml indexdv.war
Copy indexdv.ear to %JBOSS_HOME\server\default\deploy
http://localhost:8080/index.jsp now works
You can add subdirectories, graphics and any other files here:
c:\app\code
Be sure to amend the jar command to add those directoris like:
jar -cvf indexdv.war META-INF/*.xml ce/*.* css/*.* ads robots.txt *.htm *.html *.jsp
You can also amend the content root to something besides root:
<context-root>/jsp</context-root>