|
|
| Added: |
> > |
Hey Tim, just found out how to do it... Just make sure that your J2EE Build Settings are set to create a web module exploded directory, and whenever you modify a .vm file, just recompile Ctrl+F9 and the file is copied fast, indicating that all files are up to date. No need to restart Tomcat... whohoooo!
-- EmilioSuarezCisco - 06 Feb 2004 |
|
|
| Added: |
> > |
QUESTIONS
|
| Added: |
> > |
I want to work in an exploded directory, but do NOT want the files copied from the src directories. I want this so that I can edit template files and see the changes immediately without restarting tomcat. If I make the changes in the current exploded files, they will be 'lost' because they are just copies.
-- TimColson 03 Feb 2004 |
|
|
| Added: |
> > |
Is there a way to copy modified web resources, such as JSP files, to the exploded directory without rebuilding the entire module? -- MikeKlumpenaar 27 Jan 2004 |
|
|
| Changed: |
< < |
- in the Web module build settings tab we can see that deployment directory will be created in SampleWebModule?\deploy
| > > |
In the Web module build settings tab we can see that:
- deployment directory will be created in SampleWebModule?\deploy
- WAR file will be created in SampleWebModule?\SampleWebModule.war
|
| Added: |
> > |
|
| Changed: |
< < |
%META:FILEATTACHMENT{name="webref.zip" attr="" comment="" date="1073558113" path="d:\work\webref.zip" size="96686" user="AlexeyKudravtsev" version="1.1"}%
| > > |
%META:FILEATTACHMENT{name="webref.zip" attr="" comment="" date="1074775390" path="D:\Work\webref.zip" size="100577" user="AlexeyKudravtsev" version="1.2"}%
|
| Changed: |
< < |
%META:FILEATTACHMENT{name="buildsettings.gif" attr="h" comment="" date="1073558518" path="C:\Documents and Settings\cdr\My Documents\My Pictures\buildsettings.gif" size="101843" user="AlexeyKudravtsev" version="1.1"}%
| > > |
%META:FILEATTACHMENT{name="buildsettings.gif" attr="h" comment="" date="1074775586" path="C:\Documents and Settings\cdr\My Documents\My Pictures\buildsettings.gif" size="13908" user="AlexeyKudravtsev" version="1.2"}% |
|
|
| Changed: |
< < |
- Specify web root directories. Web root is a directory containing web specific resources like JSP files, additional deployment descriptors etc that you want to be eventually located somewhere inside deployment directory. To edit web roots, go to Settings/Paths, choose web module, select directory and press 'mark Web root/unmark Web root' button. Note that each web root contains relative path entry where corresponding files will be copied in deployment directory.
- Specify Web module build settings (these can be found in Settings/Paths/your web module/Build Settings tab).
| > > |
- Specify web resource directories. Web resource directory contains web specific stuff like JSP files, additional deployment descriptors etc that you want to be eventually located somewhere inside deployment directory. To edit web resource dirs, go to Settings/Paths/(Your web module)/Web Module tab/Web Resource Directory pane. Note that each web resource directory contains relative path entry where corresponding files will be copied in deployment directory.
- Specify Web module build settings (these can be found in Settings/Paths/(your web module)/J2EE Build Settings tab).
|
| Changed: |
< < |
-
-
- adding corresponding libraries to the web module (Settings/Paths/your web module/Libraries tab)
| > > |
-
-
- adding corresponding libraries to the web module (Settings/Paths/(your web module)/Libraries tab)
|
| Changed: |
< < |
How to make the Web Module and build all necessary WAR file and/or exploded directory for deployment ?
- Press Ctrl-F9 (Make Project) of course! (or, select 'Compile module XXX' context menu from the Project/J2EE View if you want to compile this Web module and dependant modules only)
| > > |
How to compile the Web Module and build all necessary WAR file and/or exploded directory for deployment ?
- Press Ctrl-F9 (Make Project). This will make all project including your web module.
- select 'Compile module XXX' in module context menu in the Project or J2EE View. This will recompile this Web module and dependant modules only
- select 'Make module XXX' in module context menu in the Project or J2EE View. This will compile this Web module and dependant modules changed files.
|
| Changed: |
< < |
- Directory SampleWebModule?\webresources marked as web root. Hello.jsp file is located here.
| > > |
- Directory SampleWebModule?\webresources marked as web resource directory. Hello.jsp file is located here.
|
| Changed: |
< < |
- Setup web module run configuration. There is exsiting run configuration 'SampleWeb' which is setup to run Tomcat 5.0 server. You will need to adjust tomcat installation location paths to run that configuration successfully.
- Run web module. Tomcat server should start. Open browser and point it to the e.g. http://localhost:8080/examples (if your tomcat was setup to use localhost and port 8080 and context /examples). HelloServlet? output will appear proposing to hyperlink to hello.jsp.
| > > |
- Setup web module run configuration. There is run configuration 'SampleWeb' which is setup to run Tomcat 5.0 server. You will need to adjust tomcat installation location paths to run that configuration successfully.
- Run web module. Tomcat server should start. Open browser and point it to the e.g. http://localhost:8080/examples (if your tomcat was setup to use localhost and port 8080 and context '/examples'). HelloServlet? output will appear showing hyperlink to 'hello.jsp'.
|
| Added: |
> > |
|
| Changed: |
< < |
%META:FILEATTACHMENT{name="run.gif" attr="h" comment="" date="1073558484" path="C:\Documents and Settings\cdr\My Documents\My Pictures\run.gif" size="113125" user="AlexeyKudravtsev" version="1.1"}%
%META:FILEATTACHMENT{name="webmodule.gif" attr="h" comment="" date="1073559391" path="C:\Documents and Settings\cdr\My Documents\My Pictures\webmodule.gif" size="1129758" user="AlexeyKudravtsev" version="1.2"}%
| > > |
%META:FILEATTACHMENT{name="run.gif" attr="h" comment="" date="1074504738" path="C:\Documents and Settings\cdr\My Documents\My Pictures\run.gif" size="1673110" user="AlexeyKudravtsev" version="1.2"}%
%META:FILEATTACHMENT{name="webmodule.gif" attr="h" comment="" date="1074504926" path="C:\Documents and Settings\cdr\My Documents\My Pictures\webmodule.gif" size="18002" user="AlexeyKudravtsev" version="1.3"}%
|
| Changed: |
< < |
%META:FILEATTACHMENT{name="paths.gif" attr="h" comment="" date="1073558534" path="C:\Documents and Settings\cdr\My Documents\My Pictures\paths.gif" size="76341" user="AlexeyKudravtsev" version="1.1"}%
| > > |
%META:FILEATTACHMENT{name="paths.gif" attr="h" comment="" date="1074505057" path="C:\Documents and Settings\cdr\My Documents\My Pictures\paths.gif" size="20665" user="AlexeyKudravtsev" version="1.2"}% |
|
|
| Changed: |
< < |
| > > |
|
| Changed: |
< < |
- Enable J2EESupport for the project
- Goto 'Web Modules', choose 'Create new Web Module', specify .iml file location, content roots, web.xml dile location. Web.xml should be located under web module content root.
- By pressing F4 at the web module in the J2EE View you can edit various web module properties:
- General Tab/web.xml deployment descriptor location corresponding to this web module. When changed, new web.xml will be reparsed to reveal all containing servlets, filters, etc.
- General Tab/Web roots table. Web root is a directory containing web-specific resources like JSP, HTML, XML files. It's contents will be copied to the web module output directory according to the web root relative path specified.
- General Tab/Servlets list. You can create/edit/remove servlet classes. Web.xml references will be updated automatically.
- General Tab/Filters list. You can create/edit/remove filter classes. Web.xml references will be updated automatically.
- Assembly Descriptor Tab/Security Roles. List of the security roles configured in the web.xml.
- Assembly Descriptor Tab/Context Parameters. List of the context parameters configured in the web.xml.
- Assembly Descriptor Tab/Servlet Mappings. Servlet to URL mappings configured in the web.xml.
| > > |
Web module is a special kind of IDEA module (see IDEA project/IDEA module structure) which, in addition to usual Java module attributes (like source directories, compiler output directory, etc) knows much about Web applications:
- Web module contains Web application deployment descriptor (aka web.xml) location and structure, including:
- servlets, their init parameters, URL mappings
- filters, their init parameters
- security roles, context parameters
- JSP files
- Web module knows of Web application deployment directory structure, either inside WAR file or in exploded directory format. Web module is able to construct deployment directory structure during module make process. Details see below (What exactly J2EE make is doing)
- Web module knows how to start and deploy itself to the application server (Tomcat 4.x,5,x and BEA WebLogic are supported now)
All Web module settings can be edited from J2EE View by pressing F4 on the selected Web module or servlet. Or, from the Settings/Paths/your web module.
- Go to 'File/New module' menu item. (alternatively, you can choose Web modules node in the J2EE View if it shown and select 'New/ Web Module' from there)
- In the Web module create wizard, specify .iml file location, module root, source directories, web.xml file location.
- Specify web root directories. Web root is a directory containing web specific resources like JSP files, additional deployment descriptors etc that you want to be eventually located somewhere inside deployment directory. To edit web roots, go to Settings/Paths, choose web module, select directory and press 'mark Web root/unmark Web root' button. Note that each web root contains relative path entry where corresponding files will be copied in deployment directory.
- Specify Web module build settings (these can be found in Settings/Paths/your web module/Build Settings tab).
|
| Changed: |
< < |
-
- Build Settings Tab/Java utility modules. List of the IDEA Java modules contained in this project you want to be a part of this Web application. Each specified Java module output will be copied to the Web module output under correposding relative path, e.g. WEB-INF/classes.
- Build Settings Tab/Libraries. List of the libraries you want to attach to this Web application. Each library can be a simple jar file, IDEA module library, IDEA project library or an IDEA global library. All containing jar files will be copied to the Web module output under correposding relative path, e.g. WEB-INF/lib.
- When Web module configured, press F9 (make project). Make process consists of the following steps:
| > > |
- Specify libraries and classes that should be in the WEB-INF/lib and WEB-INF/classes directories. (these can be found in Settings/Paths/your web module/Web module tab)
- to specify libraries, you are:
- adding corresponding libraries to the web module (Settings/Paths/your web module/Libraries tab)
- selecting which libraries and under what relative paths (usually /WEB-INF/lib) to copy into your deployment directory (Settings/Paths/your web module/Web module tab - Modules and Libraries to deploy)
- you can also specify classes which are come from other IDEA Java module and go into e.g. WEB-INF/classes:
- mark corresponding Java module dependant for this Web module (Settings/Paths/your web module/Dependencies tab)
- check that Java module and specify relative path (Settings/Paths/your web module/Web module tab - Modules and Libraries to deploy)
How to make the Web Module and build all necessary WAR file and/or exploded directory for deployment ?
- Press Ctrl-F9 (Make Project) of course! (or, select 'Compile module XXX' context menu from the Project/J2EE View if you want to compile this Web module and dependant modules only)
|
| Changed: |
< < |
-
- Java classes under the source directories will be compiled and then copied to the WEB-INF/classes. Please adjust the compiler settings for copying resource files if you do not want to copy some specific files e.g. JSP files from the source folders into WEB-INF/classes.
- Web roots will be copied to the Web module output directory acoording to the web root relative paths.
- Containing java utility modules and libraries configured will be copied to the web module output directory corresponding to the relative paths.
- web.xml copied into WEB-INF directory
| > > |
- Java classes under the source directories will be compiled into respective compiler output directories and then copied to the WEB-INF/classes. Please adjust the compiler settings for copying resource files if you do not want to copy some specific files e.g. JSP files from the source folders into WEB-INF/classes.
- Web roots will be copied to the Web module output directory according to the web root relative paths.
- Containing java utility modules and libraries configured will be copied to the web module output directory corresponding to the relative paths.
- web.xml copied into WEB-INF directory
- Download and unzip the attached project into temp directory, open webref.ipr
- The project consists of the one and only module: SampleWebModule?. You can inspect how its configured:
Please note that
- Module output path is set to SampleWebModule?\classes, so that Java classes will go that directory on compile.
- Source directory created in SampleWebModule?\src.
- Directory SampleWebModule?\webresources marked as web root. Hello.jsp file is located here.
- Servlet-api.jar is placed into lib directory and added to the module libraries, so that we can use web app-specific classes during Java code developing. You can as well configure project or global library containing servlet classes and attach it to the module.
- in the Web module tab we can see that deployment descriptor location set up to SampleWebModule?\web.xml
- in the Web module build settings tab we can see that deployment directory will be created in SampleWebModule?\deploy
- Make the project
- Setup web module run configuration. There is exsiting run configuration 'SampleWeb' which is setup to run Tomcat 5.0 server. You will need to adjust tomcat installation location paths to run that configuration successfully.
- Run web module. Tomcat server should start. Open browser and point it to the e.g. http://localhost:8080/examples (if your tomcat was setup to use localhost and port 8080 and context /examples). HelloServlet? output will appear proposing to hyperlink to hello.jsp.
|
| Added: |
> > |
%META:FILEATTACHMENT{name="webref.zip" attr="" comment="" date="1073558113" path="d:\work\webref.zip" size="96686" user="AlexeyKudravtsev" version="1.1"}%
%META:FILEATTACHMENT{name="run.gif" attr="h" comment="" date="1073558484" path="C:\Documents and Settings\cdr\My Documents\My Pictures\run.gif" size="113125" user="AlexeyKudravtsev" version="1.1"}%
%META:FILEATTACHMENT{name="webmodule.gif" attr="h" comment="" date="1073559391" path="C:\Documents and Settings\cdr\My Documents\My Pictures\webmodule.gif" size="1129758" user="AlexeyKudravtsev" version="1.2"}%
%META:FILEATTACHMENT{name="buildsettings.gif" attr="h" comment="" date="1073558518" path="C:\Documents and Settings\cdr\My Documents\My Pictures\buildsettings.gif" size="101843" user="AlexeyKudravtsev" version="1.1"}%
%META:FILEATTACHMENT{name="paths.gif" attr="h" comment="" date="1073558534" path="C:\Documents and Settings\cdr\My Documents\My Pictures\paths.gif" size="76341" user="AlexeyKudravtsev" version="1.1"}% |
|
|
| Added: |
> > |
%META:TOPICINFO{author="AlexeyKudravtsev" date="1070892120" format="1.0" version="1.1"}%
%META:TOPICPARENT{name="J2EESupport"}%
- Enable J2EESupport for the project
- Goto 'Web Modules', choose 'Create new Web Module', specify .iml file location, content roots, web.xml dile location. Web.xml should be located under web module content root.
- By pressing F4 at the web module in the J2EE View you can edit various web module properties:
- General Tab/web.xml deployment descriptor location corresponding to this web module. When changed, new web.xml will be reparsed to reveal all containing servlets, filters, etc.
- General Tab/Web roots table. Web root is a directory containing web-specific resources like JSP, HTML, XML files. It's contents will be copied to the web module output directory according to the web root relative path specified.
- General Tab/Servlets list. You can create/edit/remove servlet classes. Web.xml references will be updated automatically.
- General Tab/Filters list. You can create/edit/remove filter classes. Web.xml references will be updated automatically.
- Assembly Descriptor Tab/Security Roles. List of the security roles configured in the web.xml.
- Assembly Descriptor Tab/Context Parameters. List of the context parameters configured in the web.xml.
- Assembly Descriptor Tab/Servlet Mappings. Servlet to URL mappings configured in the web.xml.
- Build Settings Tab/Web Module Jar File. Tells IDEA to create corresponding WAR file and allows to specify its location.
- Build Settings Tab/Web Module Exploded Directory. Tells IDEA to create J2EE Web Application directory and allows to specify its location.
- Build Settings Tab/Java utility modules. List of the IDEA Java modules contained in this project you want to be a part of this Web application. Each specified Java module output will be copied to the Web module output under correposding relative path, e.g. WEB-INF/classes.
- Build Settings Tab/Libraries. List of the libraries you want to attach to this Web application. Each library can be a simple jar file, IDEA module library, IDEA project library or an IDEA global library. All containing jar files will be copied to the Web module output under correposding relative path, e.g. WEB-INF/lib.
- When Web module configured, press F9 (make project). Make process consists of the following steps:
- if Build Settings/Create Web Module Jar File is checked, then WAR file will be created with the contents specified below.
- if Build Settings/Create Web Module Exploded directory is checked, then J2EE Application directory will be created with the contents specified below.
- Java classes under the source directories will be compiled and then copied to the WEB-INF/classes. Please adjust the compiler settings for copying resource files if you do not want to copy some specific files e.g. JSP files from the source folders into WEB-INF/classes.
- Web roots will be copied to the Web module output directory acoording to the web root relative paths.
- Containing java utility modules and libraries configured will be copied to the web module output directory corresponding to the relative paths.
- web.xml copied into WEB-INF directory
-- AlexeyKudravtsev - 08 Dec 2003 |
View
| Diffs | r1.7 | > | r1.6 | > | r1.5
| More
|
|