Finally off 977


Yay... I finally got 1071 going after being stuck on 977 for a long time.
Excellent. An observation:

I hate to say it but a wizard would be useful to guide you through the setup
process here. I'm not overly fond of wizards but in this case I think it
would be helpful. The current project wizard seems out of date with all the
changes that have happened. Are there any plans on updating it?

Regards,

Glen


7 comments
Comment actions Permalink

Glen Stampoultzis wrote:

Yay... I finally got 1071 going after being stuck on 977 for a long time.
Excellent. An observation:

I hate to say it but a wizard would be useful to guide you through the setup
process here. I'm not overly fond of wizards but in this case I think it
would be helpful. The current project wizard seems out of date with all the
changes that have happened. Are there any plans on updating it?


Glen, go to the file menu, choose new module, choose web module and
follow the wizard :)

R

0
Comment actions Permalink


Oh... well that's really not much of a wizard IMHO.

Some points:

1. Very little descriptive text. (One of the main advantages of having a
wizard).
2. It doesn't mark the web root.
3. It doesn't setup the J2EE Build Settings. I'm left wondering at the end
of the process whether I need to create a jar or an exploded directory and
where to put them.
4. It's unclear what I should be setting my content root to and what
relationship that has to the web root.
5. It doesn't offer to setup any of the libraries I have in WEB-INF/lib
6. It doesn't set the output path. Should I be setting it to
WEB-INF/classes or somewhere else?
7. It doesn't setup the src paths or provide any information as to the
prefered place to put these.
8. The target JDK doesn't get set.

A good wizard should address those things. The fact that the new project
wizard doesn't deal with modules at all doesn't help things either.

Regards,

Glen


"Robert S. Sfeir" <robert@codepuccino.com> wrote in message
news:btea9d$qev$2@is.intellij.net...

Glen Stampoultzis wrote:

>

Yay... I finally got 1071 going after being stuck on 977 for a long

time.

Excellent. An observation:

>

I hate to say it but a wizard would be useful to guide you through the

setup

process here. I'm not overly fond of wizards but in this case I think

it

would be helpful. The current project wizard seems out of date with all

the

changes that have happened. Are there any plans on updating it?

>

Glen, go to the file menu, choose new module, choose web module and
follow the wizard :)

>

R



0
Comment actions Permalink

+100! You nailed it on the head.

I, and others, have figured it out via some real painful trial and
error, so it's real easy for me now, but I can see that if 4.0 were
released today, the community forum would immediately jump with the same
issues we're having here and worse!

Still once you figure out how to do it, it absolutely Rocks! I gave a
demo of it to the rest of the developers at work today, and they were
just blown away by how cool it is. Of course I setup all the modules
for everyone, so they don't have to go through the pain.

R

Glen Stampoultzis wrote:

Oh... well that's really not much of a wizard IMHO.

Some points:

1. Very little descriptive text. (One of the main advantages of having a
wizard).
2. It doesn't mark the web root.
3. It doesn't setup the J2EE Build Settings. I'm left wondering at the end
of the process whether I need to create a jar or an exploded directory and
where to put them.
4. It's unclear what I should be setting my content root to and what
relationship that has to the web root.
5. It doesn't offer to setup any of the libraries I have in WEB-INF/lib
6. It doesn't set the output path. Should I be setting it to
WEB-INF/classes or somewhere else?
7. It doesn't setup the src paths or provide any information as to the
prefered place to put these.
8. The target JDK doesn't get set.

A good wizard should address those things. The fact that the new project
wizard doesn't deal with modules at all doesn't help things either.

Regards,

Glen


"Robert S. Sfeir" <robert@codepuccino.com> wrote in message
news:btea9d$qev$2@is.intellij.net...

>>Glen Stampoultzis wrote:
>>
>>
>>>Yay... I finally got 1071 going after being stuck on 977 for a long


time.

>>>Excellent. An observation:
>>>
>>>I hate to say it but a wizard would be useful to guide you through the


setup

>>>process here. I'm not overly fond of wizards but in this case I think


it

>>>would be helpful. The current project wizard seems out of date with all


the

>>>changes that have happened. Are there any plans on updating it?
>>
>>Glen, go to the file menu, choose new module, choose web module and
>>follow the wizard :)
>>
>>R


0
Comment actions Permalink

Functionality wise it does seem pretty nice although I still have a lot of
questions. I managed to get it going but there's a lot of doubt in my head
whether my particular setup is the right way to be doing it. I'm still
confused about a lot of the features too. Since you seem to have a good
handle on it let me ask you a few things:

1. What is the relationship between libraries in the WEB-INF/lib directory
and project libraries. Do jars in WEB-INF/lib get ignored? Where should I
be keeping my jars?
2. Is it better to define project level libraries, module level libraries or
global libraries. It's nice to have these choices but I'm not sure what's
best option.
3. Where should I be compiling my classes to? WEB-INF/classes or somewhere
else?
4. When running a web app what does the 'include module classpath' option
do?
5. What's the launcher and why do I need it?
6. Is it better to run tomcat externally or have idea start it?
7. Should I exclude the classes directory?
8. What's the best place to put the src directories?

It's starting to sound like an example best practices web project would be
useful.

Regards,

Glen


"Robert S. Sfeir" <robert@codepuccino.com> wrote in message
news:btfpnn$2c1$1@is.intellij.net...

+100! You nailed it on the head.

>

I, and others, have figured it out via some real painful trial and
error, so it's real easy for me now, but I can see that if 4.0 were
released today, the community forum would immediately jump with the same
issues we're having here and worse!

>

Still once you figure out how to do it, it absolutely Rocks! I gave a
demo of it to the rest of the developers at work today, and they were
just blown away by how cool it is. Of course I setup all the modules
for everyone, so they don't have to go through the pain.

>

R

>


0
Comment actions Permalink

Glen Stampoultzis wrote:

Functionality wise it does seem pretty nice although I still have a lot of
questions. I managed to get it going but there's a lot of doubt in my head
whether my particular setup is the right way to be doing it. I'm still
confused about a lot of the features too. Since you seem to have a good
handle on it let me ask you a few things:


I'll try my best.


1. What is the relationship between libraries in the WEB-INF/lib directory
and project libraries. Do jars in WEB-INF/lib get ignored? Where should I
be keeping my jars?


this is the beauty of it. Keep your jars where ever you want. One you
setup your jars as a Module, Project or Global library, you will see
that they show up under the Web Module tab. If you check off the box,
in that tab in the Child settings, bottom window, it will automatically
add them to WEB-INF/lib. Now when you set your exploded directory, idea
will automatically copy them to that location for you. If your app is
setup as a webroot, then it won't copy them anywhere, and I wouldn't
check off the box.

2. Is it better to define project level libraries, module level libraries or
global libraries. It's nice to have these choices but I'm not sure what's
best option.


I like Global because I can reuse them in my other projects. If I have
some libraries that are very specific to my project, like when I work on
Portlets for the plumtree portal, then I make them Project Libraries.
There is rarely a care for me when I use Module libs, unless I have a
module which I need to compile with an older library. Global is my
first choice since I don't have to setup libs over and over. I just
check off the boxes and I'm done.

3. Where should I be compiling my classes to? WEB-INF/classes or somewhere
else?


Depends on how you have your whole setup put together. personally I put
them in my project in a build/classes directory. I never point anything
to my webapp root, where I have my exploded dir. If you don't have an
exploded dir, then WEB-INF/classes is definitely the appropriate spot
for this.

4. When running a web app what does the 'include module classpath' option
do?


It will add all the jars which belong to the module. I find that pretty
useless. Others might find it useful.

5. What's the launcher and why do I need it?


Dunno, good question.

6. Is it better to run tomcat externally or have idea start it?


I MUCH prefer to start the idea plugin. I get full debug and hotswap
loading, I never have to start anything external. The nice thing is
that if you work with Portlets and hence have multiple web modules in
one project, you just switch your run config, press debug icon and
you're set to go with the new web module. It's perfect, very efficient,
and much more powerful than running Tomcat externally, where all your
web apps will load up, and you have to deal with the context root etc...
In my case I setup one context in Tomcat (/webapp) and all my web
modules run under the same root. So if I stop and start Tomcat with a
different app, one bookmark in my browser fires up the right app.

7. Should I exclude the classes directory?


it does that automatically, however if you have WEB-INF/classes because
you have a simple webroot, then no I don't think you should.

8. What's the best place to put the src directories?


Well again this is a preference thing. people who have a simple web
module put it at the root of their project, I personally have it in the
project but not as part of the web module. For example, if you like
3.0.5 style Web Modules, then your setup would be something like this:

jsps images styles scripts src WEB-INF classes lib tld web.xml With that setup you don't need to set an exploded directory. your dir is already in the form of a webroot. With the type of setup I like, it's more complex, but it's cleaner when you want to use CVS to store the info (again my opinion) ]]>
classes (output)
src (output to classes)
media (mark as webroot with / mount point)
images
styles
scripts
jsps (mark as webroot with / mount point)
index.jsp
common
security
resources (no mark)
web.xml
struts (mark as webroot with /WEB-INF as mount point)
struts-config.xml
...
ojb (mark as webroot with /WEB-INF as mount point)
repository.xml
...
tlds (mark as webroot with /WEB-INF/tlds as mount point)
... some tld docs
libs (set as Project Lib, with Child destination of /WEB-INF/lib)
webapps (this is where I explode everything into, the results would
look like this:)

webapps
index.jsp
common
security
images
styles
scripts
WEB-INF
web.xml
struts-config.xml (and others from struts dir)
repository.xml (and others from ojb dir)
tlds
(tlds in the dir)
lib
(libraries from the project libs)
classes
(compiled classes from classes dir are copied here)


If you chose a war file instead of exploded dir, you'd get the same
structure, but in a war file.

That's it!

It's starting to sound like an example best practices web project would be
useful.


I uploaded one about week ago when we got 1050. But everyone does it
differently.


Hope this helps a little.

R

0
Comment actions Permalink

4. When running a web app what does the 'include
module classpath' option
do?


I think it's a leftover of the old webapp stuff. It shouldn't be needed anymore since all classes and libraries are put together correctly by the web module.

5. What's the launcher and why do I need it?


If you use the launcher then you can dump a complete stack trace of all threads in you're app at any time. This can be helpful in multithreaded applications, but I'm not sure if its very helpful for web apps.

It's starting to sound like an example best practices
web project would be
useful.


It's not a 'best practices' example, but a 'how it can work' example:

http://www.intellij.net/forums/thread.jsp?forum=4&thread=23887&message=763077#763077

0
Comment actions Permalink

Thanks that. Reply inline.


"Robert S. Sfeir" <robert@codepuccino.com> wrote in message
news:btftof$kjh$1@is.intellij.net...

Glen Stampoultzis wrote:

>

Functionality wise it does seem pretty nice although I still have a lot

of

questions. I managed to get it going but there's a lot of doubt in my

head

whether my particular setup is the right way to be doing it. I'm still
confused about a lot of the features too. Since you seem to have a good
handle on it let me ask you a few things:

>

I'll try my best.

>

>

1. What is the relationship between libraries in the WEB-INF/lib

directory

and project libraries. Do jars in WEB-INF/lib get ignored? Where

should I

be keeping my jars?

>

this is the beauty of it. Keep your jars where ever you want. One you
setup your jars as a Module, Project or Global library, you will see
that they show up under the Web Module tab. If you check off the box,
in that tab in the Child settings, bottom window, it will automatically
add them to WEB-INF/lib. Now when you set your exploded directory, idea
will automatically copy them to that location for you. If your app is
setup as a webroot, then it won't copy them anywhere, and I wouldn't
check off the box.


Think I've got that. So if it's already in WEB-INF lib will it become part
of the classpath of a running webapp regardless?

The interface lets you have an exploded directory AND mark a web root does
that create any complications (seems to be working for me).

2. Is it better to define project level libraries, module level

libraries or

global libraries. It's nice to have these choices but I'm not sure

what's

best option.

>

I like Global because I can reuse them in my other projects. If I have
some libraries that are very specific to my project, like when I work on
Portlets for the plumtree portal, then I make them Project Libraries.
There is rarely a care for me when I use Module libs, unless I have a
module which I need to compile with an older library. Global is my
first choice since I don't have to setup libs over and over. I just
check off the boxes and I'm done.


Global libraries do seem useful but makes ant build files a little more
complicated than I'd like.

3. Where should I be compiling my classes to? WEB-INF/classes or

somewhere

else?

>

Depends on how you have your whole setup put together. personally I put
them in my project in a build/classes directory. I never point anything
to my webapp root, where I have my exploded dir. If you don't have an
exploded dir, then WEB-INF/classes is definitely the appropriate spot
for this.


Okay... sounds like exploded dirs = good.

I assume that if your web module depends on any other module it's manditory
to have an exploded dir.

4. When running a web app what does the 'include module classpath'

option

do?

>

It will add all the jars which belong to the module. I find that pretty
useless. Others might find it useful.

>

5. What's the launcher and why do I need it?

>

Dunno, good question.

>

6. Is it better to run tomcat externally or have idea start it?

>

I MUCH prefer to start the idea plugin. I get full debug and hotswap
loading, I never have to start anything external. The nice thing is
that if you work with Portlets and hence have multiple web modules in
one project, you just switch your run config, press debug icon and
you're set to go with the new web module. It's perfect, very efficient,
and much more powerful than running Tomcat externally, where all your
web apps will load up, and you have to deal with the context root etc...
In my case I setup one context in Tomcat (/webapp) and all my web
modules run under the same root. So if I stop and start Tomcat with a
different app, one bookmark in my browser fires up the right app.

>

Works for me.

7. Should I exclude the classes directory?

>

it does that automatically, however if you have WEB-INF/classes because
you have a simple webroot, then no I don't think you should.

>

8. What's the best place to put the src directories?

>

Well again this is a preference thing. people who have a simple web
module put it at the root of their project, I personally have it in the
project but not as part of the web module. For example, if you like
3.0.5 style Web Modules, then your setup would be something like this:

>

<project roo - also mark this as Web Root with / as relative mount point)>
jsps
images
styles
scripts
src
WEB-INF
classes
lib
tld
web.xml

>

With that setup you don't need to set an exploded directory. your dir
is already in the form of a webroot.

>

With the type of setup I like, it's more complex, but it's cleaner when
you want to use CVS to store the info (again my opinion)

>

<project root (no mark here)>
classes (output)
src (output to classes)
media (mark as webroot with / mount point)
images
styles
scripts
jsps (mark as webroot with / mount point)
index.jsp
common
security
resources (no mark)
web.xml
struts (mark as webroot with /WEB-INF as mount point)
struts-config.xml
...
ojb (mark as webroot with /WEB-INF as mount point)
repository.xml
...
tlds (mark as webroot with /WEB-INF/tlds as mount point)
... some tld docs
libs (set as Project Lib, with Child destination of /WEB-INF/lib)
webapps (this is where I explode everything into, the results would
look like this:)

>

webapps
index.jsp
common
security
images
styles
scripts
WEB-INF
web.xml
struts-config.xml (and others from struts dir)
repository.xml (and others from ojb dir)
tlds
(tlds in the dir)
lib
(libraries from the project libs)
classes
(compiled classes from classes dir are copied here)

>
>

If you chose a war file instead of exploded dir, you'd get the same
structure, but in a war file.





0

Please sign in to leave a comment.