heman7719
asked on
Learn Struts.. prt 2
Hi, after go through the URL and aritcel regarding sturts, I have some doubts and question. beofre that, do share me your attention on listening to my explanation on Sturts.
1st version (Dummy version)
====================
1. each time user (browser) will call the controller (Action Servlet).
2. Then in the ActionServlet, it will determine or delegates the responsibilities to JSP/Classes/Form based on the sequence.
3. The sequencing is set in the web.xml program.
4. The classes is my own customize java program on achieve something or control or validate something.
5. Display the end-result to user using JSP with JSTL tag.
6. One cycle end. If user want to have another round, thwe whole cycle will repeat again.
2nd version (more technical)
====================
1. Browser willc all the servlet. based on the web,xml program, it'll map the location of the ActionServlet in using XML tag.
2. After that ActionServlet will delegate the responsibilities using struts-config.xml to map some of the Action Class (Java class), JSP. In sturts-config.xml, it's also shown the sequence of the loading program (JSP/JavaClass).
3. In the Action Class, I can have my own custom method or custome code to perfom my own custom logic.
4. JSP view is using the JSTL concepts plus the session functionalities.
Question:
1. Do i need to code the struts-config.xml manually? Is it exist when I download the struts.jar into my project? This is because my web.xml will come out automatically.
2. What is ActionForm? It's seems that it's esential for me to have this before my JSP page can come out.
3. ActionError. What is this? Is it prebuild by struts or I have code myself.
4. Where should i put the strut-confi,xml is I need to create myown. WEB-INF/lib , or WEB-INF/Classes?
i think overall, I understand this framework will ease my time on creating the program for me. But I don't know which one is inbuild and which one I have to create my own.
Please correct me for the explanation above if there is anything wrong.
1st version (Dummy version)
====================
1. each time user (browser) will call the controller (Action Servlet).
2. Then in the ActionServlet, it will determine or delegates the responsibilities to JSP/Classes/Form based on the sequence.
3. The sequencing is set in the web.xml program.
4. The classes is my own customize java program on achieve something or control or validate something.
5. Display the end-result to user using JSP with JSTL tag.
6. One cycle end. If user want to have another round, thwe whole cycle will repeat again.
2nd version (more technical)
====================
1. Browser willc all the servlet. based on the web,xml program, it'll map the location of the ActionServlet in using XML tag.
2. After that ActionServlet will delegate the responsibilities using struts-config.xml to map some of the Action Class (Java class), JSP. In sturts-config.xml, it's also shown the sequence of the loading program (JSP/JavaClass).
3. In the Action Class, I can have my own custom method or custome code to perfom my own custom logic.
4. JSP view is using the JSTL concepts plus the session functionalities.
Question:
1. Do i need to code the struts-config.xml manually? Is it exist when I download the struts.jar into my project? This is because my web.xml will come out automatically.
2. What is ActionForm? It's seems that it's esential for me to have this before my JSP page can come out.
3. ActionError. What is this? Is it prebuild by struts or I have code myself.
4. Where should i put the strut-confi,xml is I need to create myown. WEB-INF/lib , or WEB-INF/Classes?
i think overall, I understand this framework will ease my time on creating the program for me. But I don't know which one is inbuild and which one I have to create my own.
Please correct me for the explanation above if there is anything wrong.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you mr_cool. If my explanation is not 100% accurate. Maybe you can explan your own version of sturts for me. Sometime words from mouth is more easy to understand. :-)
But I don't see the "example "struts-blank.war" ".
Oliver_Dornauf, thanks for your time. Maybe youcan put the sturs definition in a more easier understandable. By the way, why the "FORM" is so special. i think there is a meaning behind it right? is it thjis FORM is referring to the input page from the user?
But I don't see the "example "struts-blank.war" ".
Oliver_Dornauf, thanks for your time. Maybe youcan put the sturs definition in a more easier understandable. By the way, why the "FORM" is so special. i think there is a meaning behind it right? is it thjis FORM is referring to the input page from the user?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mr_cool, kokchoon, yes i saw the .war file already... now is going throught the step-by-step lesson guide in the
http://www.reumann.net/do/struts/lesson1/step9
:-)
http://www.reumann.net/do/struts/lesson1/step9
:-)
heman7719 ,
I said you did not cover 100% of the possible execution paths of struts. For example, one possible path is.
1. Submit for data
2. Form data is processed by the action form
3. the Action processes the request but encounters an exception (SQLException, NullPointer, etc...)
4. Action throws the exception
5. The struts controller catches the exception and passes control to the global exception handler.
This is just one path, there are many. You described the "happy" path and it was a reasonable description.
Dont feel bound by this happy path though, you can do ANYTHING you want.
eg. instead of
5. Display the end-result to user using JSP with JSTL tag.
how about:
5. Create an xml document with the results and use xsl to display the results to the user
Have fun with the tutorial :)
I said you did not cover 100% of the possible execution paths of struts. For example, one possible path is.
1. Submit for data
2. Form data is processed by the action form
3. the Action processes the request but encounters an exception (SQLException, NullPointer, etc...)
4. Action throws the exception
5. The struts controller catches the exception and passes control to the global exception handler.
This is just one path, there are many. You described the "happy" path and it was a reasonable description.
Dont feel bound by this happy path though, you can do ANYTHING you want.
eg. instead of
5. Display the end-result to user using JSP with JSTL tag.
how about:
5. Create an xml document with the results and use xsl to display the results to the user
Have fun with the tutorial :)
ASKER
ha.. mr_cool, I think that path will only come into me after I familiar with the "happy" path first... ha... because until now I am still not happy yet.... :-)
Yes, the tutorial is a fantastic choice. TQ for your recommdation. This weekend I have a serious look into it. Furthermore it's come with the .war file as well.
Let me get back to you after the reading. For sure I have thousand of question.. ha...
Yes, the tutorial is a fantastic choice. TQ for your recommdation. This weekend I have a serious look into it. Furthermore it's come with the .war file as well.
Let me get back to you after the reading. For sure I have thousand of question.. ha...
ASKER
guys.. the first war file i download can't be run... any idea from the exception below.
index.jsp [-1:-1] java.lang.ExceptionInIniti alizerErro r: java.lang.NullPointerExcep tion
at org.apache.struts.util.Mes sageResour ces.getMes sageResour ces(Messag eResources .java:577)
at org.apache.struts.taglib.h tml.BaseHa ndlerTag.< clinit>(Ba seHandlerT ag.java:10 8)
at java.lang.Class.forName0(N ative Method)
at java.lang.Class.forName(Cl ass.java:1 15)
at org.apache.strutsel.taglib .html.ELRe writeTagBe anInfo.cla ss$(ELRewr iteTagBean Info.java: 88)
at org.apache.strutsel.taglib .html.ELRe writeTagBe anInfo.get PropertyDe scriptors( ELRewriteT agBeanInfo .java:88)
at java.beans.Introspector.ge tTargetPro pertyInfo( Introspect or.java:34 1)
at java.beans.Introspector.ge tBeanInfo( Introspect or.java:29 1)
at java.beans.Introspector.ge tBeanInfo( Introspect or.java:76 )
at org.apache.jasper.compiler .TagCache. setTagHand lerClass(T agCache.ja va:116)
at org.apache.jasper.compiler .TagBeginG enerator.i nit(TagBeg inGenerato r.java:146 )
at org.netbeans.modules.web.j spparser.A nalyzerPar seEventLis tener.addG enerator(A nalyzerPar seEventLis tener.java :154)
at org.netbeans.modules.web.j spparser.A nalyzerPar seEventLis tener.hand leTagBegin (AnalyzerP arseEventL istener.ja va:962)
at org.apache.jasper.compiler .Delegatin gListener. handleTagB egin(Deleg atingListe ner.java:2 21)
at org.apache.jasper.compiler .Delegatin gListener. handleTagB egin(Deleg atingListe ner.java:2 16)
at org.apache.jasper.compiler .Parser$Ta g.accept(P arser.java :852)
at org.apache.jasper.compiler .Parser.pa rse(Parser .java:1145 )
at org.apache.jasper.compiler .Parser.pa rse(Parser .java:1103 )
at org.apache.jasper.compiler .Parser.pa rse(Parser .java:1099 )
at org.apache.jasper.compiler .ParserCon troller.pa rse(Parser Controller .java:214)
at org.netbeans.modules.web.j spparser.J spParserIm pl.callTom catParser( JspParserI mpl.java:1 26)
at org.netbeans.modules.web.j spparser.J spParserIm pl.analyze Page(JspPa rserImpl.j ava:93)
at org.netbeans.modules.web.c ore.jsploa der.JspDat aObject.cr eateCompil er(JspData Object.jav a:297)
at org.netbeans.modules.web.c ore.jsploa der.JspCom pilerSuppo rt.addToJo b(JspCompi lerSupport .java:62)
at org.openide.actions.Abstra ctCompileA ction.prep areJobFor( AbstractCo mpileActio n.java:361 )
at org.openide.actions.Abstra ctCompileA ction.crea teJob(Abst ractCompil eAction.ja va:198)
at org.openide.actions.Abstra ctCompileA ction.comp ile(Abstra ctCompileA ction.java :209)
at org.openide.actions.Abstra ctCompileA ction.comp ileNodes(A bstractCom pileAction .java:117)
at java.lang.reflect.Method.i nvoke(Nati ve Method)
at org.openide.actions.Execut eAction.co mpile(Exec uteAction. java:225)
at org.openide.actions.Execut eAction.ex ecute(Exec uteAction. java:204)
at org.openide.actions.Execut eAction.pe rformActio n(ExecuteA ction.java :102)
at org.netbeans.modules.web.e xecution.E xecuteForc eReloadAct ion.perfor mAction(Ex ecuteForce ReloadActi on.java:42 )
at org.openide.util.actions.N odeAction$ DelegateAc tion.actio nPerformed (NodeActio n.java:431 )
at org.netbeans.core.ModuleAc tions$1.ru n(ModuleAc tions.java :97)
at org.openide.util.Task.run( Task.java: 136)
at org.openide.util.RequestPr ocessor$Ta sk.run(Req uestProces sor.java:3 28)
at org.openide.util.RequestPr ocessor$Pr ocessor.ru n(RequestP rocessor.j ava:670)
index.jsp [-1:-1] java.lang.ExceptionInIniti
at org.apache.struts.util.Mes
at org.apache.struts.taglib.h
at java.lang.Class.forName0(N
at java.lang.Class.forName(Cl
at org.apache.strutsel.taglib
at org.apache.strutsel.taglib
at java.beans.Introspector.ge
at java.beans.Introspector.ge
at java.beans.Introspector.ge
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.netbeans.modules.web.j
at org.netbeans.modules.web.j
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.netbeans.modules.web.j
at org.netbeans.modules.web.j
at org.netbeans.modules.web.c
at org.netbeans.modules.web.c
at org.openide.actions.Abstra
at org.openide.actions.Abstra
at org.openide.actions.Abstra
at org.openide.actions.Abstra
at java.lang.reflect.Method.i
at org.openide.actions.Execut
at org.openide.actions.Execut
at org.openide.actions.Execut
at org.netbeans.modules.web.e
at org.openide.util.actions.N
at org.netbeans.core.ModuleAc
at org.openide.util.Task.run(
at org.openide.util.RequestPr
at org.openide.util.RequestPr
>> guys.. the first war file i download can't be run... any idea from the exception below.
which war file? Is it your own war file or an example war file.
>>index.jsp [-1:-1] java.lang.ExceptionInIniti alizerErro r: java.lang.NullPointerExcep tion
>> at org.apache.struts.util.Mes sageResour ces.getMes sageResour ces(Messag eResources .java:577)
This looks like struts cant find your message resources file.
In struts-config.xml there should be a line like:
<message-resources parameter="application" null="false"/>
This is telling struts that you have a file called application.properties. This file should be saved in /WEB-INF/classes
which war file? Is it your own war file or an example war file.
>>index.jsp [-1:-1] java.lang.ExceptionInIniti
>> at org.apache.struts.util.Mes
This looks like struts cant find your message resources file.
In struts-config.xml there should be a line like:
<message-resources parameter="application" null="false"/>
This is telling struts that you have a file called application.properties. This file should be saved in /WEB-INF/classes
ASKER
the .war file is from the websites download. the application resource is there. I mean this <message-resources parameter="application" null="false"/> is there.
And I coded my own struts.. yet again it's stuck in here...
I am using NetBean. Any potential problem you think?
And I coded my own struts.. yet again it's stuck in here...
I am using NetBean. Any potential problem you think?
do you have a file called application.properties in the /WEB-INF/classes directory?
>>index.jsp [-1:-1] java.lang.ExceptionInIniti alizerErro r: java.lang.NullPointerExcep tion
when u get the error, when u start Init. Struts ? or when u run index.jsp ? i think the posible cause is your application.properties don't have the resources required by the index.jsp
for example your index.jsp :
<bean:message key="index.login"/>
but in your application.properties don't have the resource key "index.login"
try to make sure all the required resources is updated in your application.properties, and remember to restart your servlet container after any changes on application.properties.
when u get the error, when u start Init. Struts ? or when u run index.jsp ? i think the posible cause is your application.properties don't have the resources required by the index.jsp
for example your index.jsp :
<bean:message key="index.login"/>
but in your application.properties don't have the resource key "index.login"
try to make sure all the required resources is updated in your application.properties, and remember to restart your servlet container after any changes on application.properties.
ASKER
ok. in my sturt-config.xml file, i specified this line,
<message-resources parameter="ApplicationReso urces" null="false" />
then in my WEB-INF/classes I also have a file named as
ApplicationResources.prope rties
KokChoon, this is correct. I call the page through the index.jsp
and this is it:
<%@ taglib uri="struts/bean-el" prefix="bean" %>
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@page contentType="text/html"%>
<html>
<head><link href="<html:rewrite page="/rr.css" />" rel="stylesheet" type="text/css" >
<title><bean:message key="title.employeeform " /> </title>
</head>
<body>
<h1><bean:message key="title.employeeApp" />
</H1>
<html:link page="/do/setupEmployeeFor m:>Add Employee </html:link>
<%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
<%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
</body>
</html>
<message-resources parameter="ApplicationReso
then in my WEB-INF/classes I also have a file named as
ApplicationResources.prope
KokChoon, this is correct. I call the page through the index.jsp
and this is it:
<%@ taglib uri="struts/bean-el" prefix="bean" %>
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@page contentType="text/html"%>
<html>
<head><link href="<html:rewrite page="/rr.css" />" rel="stylesheet" type="text/css" >
<title><bean:message key="title.employeeform " /> </title>
</head>
<body>
<h1><bean:message key="title.employeeApp" />
</H1>
<html:link page="/do/setupEmployeeFor
<%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
<%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
</body>
</html>
Your code looks ok...
Which war file did you download? can you provide the link?
Which war file did you download? can you provide the link?
assuming you are talking about rr_lesson_1.war.
How did you deploy the app? Did you change anything? What application server are you using?
I have just downloaded the application and deployed it on tomcat. I am not getting the error you describe. I just let tomcat deploy the application by copying the jar file to the webapps directory.
How did you deploy the app? Did you change anything? What application server are you using?
I have just downloaded the application and deployed it on tomcat. I am not getting the error you describe. I just let tomcat deploy the application by copying the jar file to the webapps directory.
some strange on :
1)
<title><bean:message key="title.employeeform " /> </title>
u have a space in "title.employeeform " is it the reason Struts can't find the resource key ? try to change it and test :
<title><bean:message key="title.employeeform" /> </title>
2)
<html:link page="/do/setupEmployeeFor m:>Add Employee </html:link>
to
<html:link page="/do/setupEmployeeFor m">Add Employee </html:link>
1)
<title><bean:message key="title.employeeform " /> </title>
u have a space in "title.employeeform " is it the reason Struts can't find the resource key ? try to change it and test :
<title><bean:message key="title.employeeform" /> </title>
2)
<html:link page="/do/setupEmployeeFor
to
<html:link page="/do/setupEmployeeFor
well spotted... These above are problems however I dont think they are the cause of the problem you described. Once you fix your initial problem these other 2 problems will become apparant too :)
I still think your application cant find the resources file. Just try and reseploy the app you downloaded without any changes and work from there...
I still think your application cant find the resources file. Just try and reseploy the app you downloaded without any changes and work from there...
ASKER
TQ for correcting me that error. But yet again it's come out.
index.jsp [-1:-1] java.lang.ExceptionInIniti alizerErro r: java.lang.NullPointerExcep tion
at org.apache.struts.util.Mes sageResour ces.getMes sageResour ces(Messag eResources .java:577)
at org.apache.struts.taglib.h tml.BaseHa ndlerTag.< clinit>(Ba seHandlerT ag.java:10 8)
at java.lang.Class.forName0(N ative Method)
at java.lang.Class.forName(Cl ass.java:1 15)
OK. This is the step i used to deploy.
I download the rr_lesson_1.war. And rename again the .war to .zip. Then I unzip it to a folder. After that I tried to mount this folder with my NetBean 3.4.1 development tools. It's using apache tomcat as a application server. But I found this error.
FYI, at first I suspect it's because of the file corrupted or some where got sme bugs. Then I decided to code my own version of the Sturts by following the steps it's mentioned. Yet, same error. Well this 2 version ( 1 download, 1 code my own ) is running on my NetBean.
cool, how can u copy the .jar file into the TOMCAR/web-apps/ folder? i think it's should be the .war file. If I do so, how can be my URL ? where should i set my context-root?
Let's say the physical location is : tomcat-home-directory/weba pps/ rrs_lesson1.war
http://localhost:8081/index.jsp ??
index.jsp [-1:-1] java.lang.ExceptionInIniti
at org.apache.struts.util.Mes
at org.apache.struts.taglib.h
at java.lang.Class.forName0(N
at java.lang.Class.forName(Cl
OK. This is the step i used to deploy.
I download the rr_lesson_1.war. And rename again the .war to .zip. Then I unzip it to a folder. After that I tried to mount this folder with my NetBean 3.4.1 development tools. It's using apache tomcat as a application server. But I found this error.
FYI, at first I suspect it's because of the file corrupted or some where got sme bugs. Then I decided to code my own version of the Sturts by following the steps it's mentioned. Yet, same error. Well this 2 version ( 1 download, 1 code my own ) is running on my NetBean.
cool, how can u copy the .jar file into the TOMCAR/web-apps/ folder? i think it's should be the .war file. If I do so, how can be my URL ? where should i set my context-root?
Let's say the physical location is : tomcat-home-directory/weba
http://localhost:8081/index.jsp ??
how about your web.xml ? check and make sure have this :
<servlet>
<servlet-name>action</serv let-name>
<servlet-class>org.apache. struts.act ion.Action Servlet</s ervlet-cla ss>
<init-param>
<param-name>application</p aram-name>
<param-value>ApplicationRe sources</p aram-value >
</init-param>
<init-param>
<param-name>config</param- name>
<param-value>/WEB-INF/stru ts-config. xml</param -value>
</init-param>
<init-param>
<param-name>debug</param-n ame>
<param-value>2</param-valu e>
</init-param>
<init-param>
<param-name>detail</param- name>
<param-value>2</param-valu e>
</init-param>
<init-param>
<param-name>validate</para m-name>
<param-value>true</param-v alue>
</init-param>
<load-on-startup>2</load-o n-startup>
</servlet>
what version of Struts u r using ?
<servlet>
<servlet-name>action</serv
<servlet-class>org.apache.
<init-param>
<param-name>application</p
<param-value>ApplicationRe
</init-param>
<init-param>
<param-name>config</param-
<param-value>/WEB-INF/stru
</init-param>
<init-param>
<param-name>debug</param-n
<param-value>2</param-valu
</init-param>
<init-param>
<param-name>detail</param-
<param-value>2</param-valu
</init-param>
<init-param>
<param-name>validate</para
<param-value>true</param-v
</init-param>
<load-on-startup>2</load-o
</servlet>
what version of Struts u r using ?
ASKER
yes. I got that.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>action</serv let-name>
<servlet-class>org.apache. struts.act ion.Action Servlet</s ervlet-cla ss>
<init-param>
<param-name>application</p aram-name>
<param-value>ApplicationRe sources</p aram-value >
</init-param>
<init-param>
<param-name>config</param- name>
<param-value>/WEB-INF/stru ts-config. xml</param -value>
</init-param>
<init-param>
<param-name>debug</param-n ame>
<param-value>3</param-valu e>
</init-param>
<init-param>
<param-name>detail</param- name>
<param-value>3</param-valu e>
</init-param>
<load-on-startup>1</load-o n-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</serv let-name>
<url-pattern>/do/*</url-pa ttern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>struts/bean-el </taglib-u ri>
<taglib-location>/WEB-INF/ struts-bea n-el.tld</ taglib-loc ation>
</taglib>
<taglib>
<taglib-uri>struts/html-el </taglib-u ri>
<taglib-location>/WEB-INF/ struts-htm l-el.tld</ taglib-loc ation>
</taglib>
<taglib>
<taglib-uri>struts/logic-e l</taglib- uri>
<taglib-location>/WEB-INF/ struts-log ic-el.tld< /taglib-lo cation>
</taglib>
<taglib>
<taglib-uri>jstl</taglib-u ri>
<taglib-location>/WEB-INF/ c.tld</tag lib-locati on>
</taglib>
</web-app>
Struts 1.1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>action</serv
<servlet-class>org.apache.
<init-param>
<param-name>application</p
<param-value>ApplicationRe
</init-param>
<init-param>
<param-name>config</param-
<param-value>/WEB-INF/stru
</init-param>
<init-param>
<param-name>debug</param-n
<param-value>3</param-valu
</init-param>
<init-param>
<param-name>detail</param-
<param-value>3</param-valu
</init-param>
<load-on-startup>1</load-o
</servlet>
<servlet-mapping>
<servlet-name>action</serv
<url-pattern>/do/*</url-pa
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>struts/bean-el
<taglib-location>/WEB-INF/
</taglib>
<taglib>
<taglib-uri>struts/html-el
<taglib-location>/WEB-INF/
</taglib>
<taglib>
<taglib-uri>struts/logic-e
<taglib-location>/WEB-INF/
</taglib>
<taglib>
<taglib-uri>jstl</taglib-u
<taglib-location>/WEB-INF/
</taglib>
</web-app>
Struts 1.1
>>l, how can u copy the .jar file into the TOMCAR/web-apps/ folder? i think it's should be the .war file. If I do so, how can be
>>my URL ? where should i set my context-root?
yes it is the .war file not the .jar file, my mistake...
>>Let's say the physical location is : tomcat-home-directory/weba pps/ rrs_lesson1.war
tomcat should extract the .war for you automarically into a directory the same name as the .war.
The url to access it will be:
http://localhost:8081/rrs_lesson1/
(by default tomcats port is 8080, I change mine to 80 so I dont have to set the port in the url)
The problem you are having may be caused by netbeans. Any chance you can just use tomcat?
What version of tomcat are you using?
>>my URL ? where should i set my context-root?
yes it is the .war file not the .jar file, my mistake...
>>Let's say the physical location is : tomcat-home-directory/weba
tomcat should extract the .war for you automarically into a directory the same name as the .war.
The url to access it will be:
http://localhost:8081/rrs_lesson1/
(by default tomcats port is 8080, I change mine to 80 so I dont have to set the port in the url)
The problem you are having may be caused by netbeans. Any chance you can just use tomcat?
What version of tomcat are you using?
ASKER
tomcat is version 4.0.6
yes. My suspecious is on the netbean. Let me do some testing. But before that mr_cool, my coding and the logic is no problem...
I got all the things that required by the web-sites to do the tutorial. I event can not run the rrs_lesson1.war file. So, dont think it's becasue of my application flow.
I got the latest apache tomcat stable version. Let me try first...
I have tomcat 4.1.27. Do you think it's fine?
yes. My suspecious is on the netbean. Let me do some testing. But before that mr_cool, my coding and the logic is no problem...
I got all the things that required by the web-sites to do the tutorial. I event can not run the rrs_lesson1.war file. So, dont think it's becasue of my application flow.
I got the latest apache tomcat stable version. Let me try first...
I have tomcat 4.1.27. Do you think it's fine?
ASKER
Apache Tomcat/4.1.27
[INFO] PropertyMessageResources - -Initializing, config='org.apache.struts. util.
LocalStrings', returnNull=true
[INFO] PropertyMessageResources - -Initializing, config='org.apache.struts. actio
n.ActionResources', returnNull=true
[INFO] PropertyMessageResources - -Initializing, config='org.apache.webapp. admin
.ApplicationResources', returnNull=true
[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080
[INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009
[INFO] JkMain - -Jk running ID=0 time=0/63 config=C:\Program Files\Apache Group
\Tomcat 4.1\conf\jk2.properties
This error come out... my God....
[INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.
LocalStrings', returnNull=true
[INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.
n.ActionResources', returnNull=true
[INFO] PropertyMessageResources - -Initializing, config='org.apache.webapp.
.ApplicationResources', returnNull=true
[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080
[INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009
[INFO] JkMain - -Jk running ID=0 time=0/63 config=C:\Program Files\Apache Group
\Tomcat 4.1\conf\jk2.properties
This error come out... my God....
ASKER
My tomcat 4.1.27 is working FINE!!!
mr_cool, what version are you running? The nenBean 3.4.1 is using 4.0.6.
:-)
but the above error seems misleading right? org.apache.struts.util returnNull=true....
anyway. TQ!
mr_cool, what version are you running? The nenBean 3.4.1 is using 4.0.6.
:-)
but the above error seems misleading right? org.apache.struts.util returnNull=true....
anyway. TQ!
ASKER
I mean strust with tomcat 4.1.27 is working fine...
For me, struts is working fine on tomcat 3.2.2 & tomcat 4.1.18 ... :)
ASKER
Any other recommdation for selecting the prefect IDE for Struts framework?
KokChoon, but how to explain my case? Do you think because of the setting I have set. Logic also...
KokChoon, but how to explain my case? Do you think because of the setting I have set. Logic also...
i never use IDE, coz i feel that is unnecessary (for me). Normally i use Textpad to do all my coding and compile in console, this is easy, u set all your classpath, and u know what is happening... IDE hide all this, of course, it maybe faster, but u will become the "client" of the IDE.
In your case, sorry i don't know about NetBean, but according your testing, seem to be the Netbean cause the problem. I don't think the problem is on tomcat 4.0.6, anyway, u can download and test to prove that is correct.
Just found a url on how to setup struts on NetBean, maybe you can find the answer on it :
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg49612.html
hth.
In your case, sorry i don't know about NetBean, but according your testing, seem to be the Netbean cause the problem. I don't think the problem is on tomcat 4.0.6, anyway, u can download and test to prove that is correct.
Just found a url on how to setup struts on NetBean, maybe you can find the answer on it :
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg49612.html
hth.
>> mr_cool, what version are you running? The nenBean 3.4.1 is using 4.0.6.
I am currently running 4.1.27, however I have had struts working on older versions of tomcat too. I think the problem is probably in the way that netbeans is using tomcat.
>> Any other recommdation for selecting the prefect IDE for Struts framework
I use either JBuilder or eclipse when developing. However I dont use any of the features they provide specifically for struts.
I avoid using the application server embedded in IDE's, they seem to cause more problems then they solve. I have found that a stand alone server works best for me. To speed up your testing you can have tomcat pointing to the same place as your editor. Just edit the server.xml and add a new <Context>.
I am currently running 4.1.27, however I have had struts working on older versions of tomcat too. I think the problem is probably in the way that netbeans is using tomcat.
>> Any other recommdation for selecting the prefect IDE for Struts framework
I use either JBuilder or eclipse when developing. However I dont use any of the features they provide specifically for struts.
I avoid using the application server embedded in IDE's, they seem to cause more problems then they solve. I have found that a stand alone server works best for me. To speed up your testing you can have tomcat pointing to the same place as your editor. Just edit the server.xml and add a new <Context>.
ASKER
mr_cool, I went in to eclipse website before. But I couldn't download any Java IDE. It's only display out this in the Download option.
May I ask which eclipse's IDE you've downloaded?
Kok Choon, when I start picking up Java, i am using Ultraedit. It's some sort like notepad, but little bit advance than notepad. I find it's useful, especially when you are new to i. Like what you said, it'll need me to code everything. But when I need to develop a system, or a complex application, I think using some light-weight IDE is going to help more than you can imagine.
May I ask which eclipse's IDE you've downloaded?
Kok Choon, when I start picking up Java, i am using Ultraedit. It's some sort like notepad, but little bit advance than notepad. I find it's useful, especially when you are new to i. Like what you said, it'll need me to code everything. But when I need to develop a system, or a complex application, I think using some light-weight IDE is going to help more than you can imagine.
ASKER
Sorry mr_cool,
when I go into ww.eclipse.org, I choose the Download option on my left. After that I choose the Main Download Sites on the right frame. Then I click the "here" in this statement, "Looking for Tools for PMC click here" .
In the final age, I only see those tools is for C++, EMF, GEF, Hyades, COBOL only. Nothing for JAVA.
That's why when people start talking they are yusing Eclipse IDE, then I have the same question and same doubt, which IDE they are downloading form the net?
when I go into ww.eclipse.org, I choose the Download option on my left. After that I choose the Main Download Sites on the right frame. Then I click the "here" in this statement, "Looking for Tools for PMC click here" .
In the final age, I only see those tools is for C++, EMF, GEF, Hyades, COBOL only. Nothing for JAVA.
That's why when people start talking they are yusing Eclipse IDE, then I have the same question and same doubt, which IDE they are downloading form the net?
download from here...
http://www.eclipse.org/downloads/index.php
The latest release is 2.11
>> Then I click the "here" in this statement, "Looking for Tools for PMC click here" .
Dont click that.. Just scroll down the page a little more and you will see
Build Type Build Name Build Date
Latest Release 2.1.1 Fri, 27 Jun 2003 -- 15:45 (-0400)
http://www.eclipse.org/downloads/index.php
The latest release is 2.11
>> Then I click the "here" in this statement, "Looking for Tools for PMC click here" .
Dont click that.. Just scroll down the page a little more and you will see
Build Type Build Name Build Date
Latest Release 2.1.1 Fri, 27 Jun 2003 -- 15:45 (-0400)
ASKER
mr_cool, downloading....
TQ for your attention....
TQ!
TQ for your attention....
TQ!
You can use a tool like J-Builder wich comes with a GUI for editing thre struts-config.xml
2. What is ActionForm? It's seems that it's esential for me to have this before my JSP page can come out.
The ActionForm is a Bean wich represents the FORM Data.
3. ActionError. What is this? Is it prebuild by struts or I have code myself.
see mr_cool
4. Where should i put the strut-confi,xml is I need to create myown. WEB-INF/lib , or WEB-INF/Classes?
see mr_cool