Re: Importing javax.faces.context.FacesContext for Glassfish



csharpdotcom wrote:
Well, I seem to eventually got it to compile through a series of trial
and
error, as the documentation I found online together with the man and
help
pages were not at all clear. I typed the following:

javac -d web/WEB-INF/classes -classpath "web/WEB-INF/lib/*" \
src/java/com/corejsf/ChangeLocaleBean.java

So the destination folder is specified first with the "-d" option,
then
the classpath, which for some reason has to be in quotes, then the
source
code. It doesn't work when the classpath is not in quotes, and must
have
something to do with the way the shell handles the wildcard. I'm
uaing
bash.

That is only part of the answer, of course. After you've compiled the classes to web/WEB-INF/classes/ (that is relative to a build/ or dist/ directory, correct?), you still have to copy the JSPs and HTMLs to web/, the JARs to web/WEB-INF/lib, then drop to web/ and jar the whole thing into a WAR file for deployment to your app server.

I usually use web/ as the source directory for web artifacts, src/ as the top of the source tree, build/ as the target of the build (so that classes go into build/WEB-INF/classes/, for example), and dist/ as the target directory to build the WAR file.

project/
|-- src/ <== Java source tree here
|-- web/ <== JSPs, HTMLs, etc.
| |-- WEB-INF/
| | |-- lib/ <== JARs
| | |-- jspf/ <== JSP fragments
| |
| |-- images/ <== other resources
| |-- style/ :
|
|-- build/ <== JSPs, HTMLs, etc., copied to here
| |-- WEB-INF/
| | |-- lib/ <== JARs copied to here
| | |-- jspf/ <== JSP fragments copied to here
| | |-- classes/ <== .class files built here
| |
| |-- images/ <== other resources copied to here
| |-- style/ :
|
|-- dist/ <== WAR file built here

This is in line with what Sun and Apache Tomcat recommend, and how most IDEs will organize your stuff.

--
Lew
.



Relevant Pages

  • Replacement problem
    ... well its a real puzzle for a fresher like me. ... source directory and creating it in the target directory during run ...
    (comp.lang.perl.misc)
  • Re: Replacement problem
    ... prasanna bhat mavinkuli wrote: ... > source directory and creating it in the target directory during run ...
    (comp.lang.perl.misc)
  • File.renameTo(File)
    ... I'm running 1.5 version of java and I'm simply attempting to move a file from a ... source directory to a target directory. ... It seems the renameTo works fewer times than it does. ...
    (comp.lang.java.programmer)
  • Re: Copy folder and paste to another folder
    ... I am trying to do the same thing except my source directory changes with ... Dim fso As Object ... The directory gets copied except I get a Type mismatch error and my ...
    (microsoft.public.excel.programming)