Sudha Joish

Greenhorn
+ Follow
since Nov 07, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sudha Joish

I use Struts 1.1 with Tomcat 5.0 as my webserver.
My JSP has 3 text boxes. All three can't be left empty and one of them is accepts an email address. I want this text box to be validated for "email" and "required".
Validation works for 'required', but doesnt work for 'email'. I am probably missing something here. Nothing happens abt the email check, it merely goes onto the next Action class - if the text box is not empty.
Please have a look at my code:
Validation.xml:


In struts_config.xml:


And in ApplicationResources.properties:

I checked validator_rules.xml. It does contain scripts to validate email.
What am I missing here? Please help.
Thanks
-- $uDhA
20 years ago
Works great.
Thanks for the imm response.
-- $uDhA
20 years ago
When users request for index.jsp, I want a SetUpAction class to be called.
With a servlet, I would edit the web.xml to get this done.
With a struts framework, I am not sure how I should edit my struts-config.xml.
At present, I have a link on my index.jsp.

And in my struts-config.xml:

Now, I want to bypass the index.jsp and arrive at the SetupAction class directly.
How can I do this?
Thanks
-- $uDhA
20 years ago
Thanks for all the replies.
JSP --> Action --> Service
I added a function to generate date_time in the Service class. This returns date_time to Action, which then sets the property.
Works like a champ.
Thanks again for all the useful pointers.
-- $uDhA
20 years ago
My JSP presents a bunch of text boxes. When user submits the JSP, I need to generate a date/time string and insert the info frm the text boxes + this date string as a new record in my DB.
I have a form bean that has getter and setter methods for text box elements and date_time ( -- a hidden field on the JSP )

JSP Submit:

Javascript:


In regular JSP/Javascript, I would have done:

But here since the form bean is associated with the form elements, when I want to set the value for a form bean property, what shd I do? Is this even possible frm a Javascript function??
Please help.
Thanks
-- $uDhA
20 years ago
Thanks a ton. That worked!
-- $uDhA
20 years ago
Please see if I have understood you right:
In the Action class:


In struts-config.xml:


In the JSP:



I still get the same error:


What am I missing here ?! Am a week new to Struts, so please tell me where I am going wrong.
Thanks
-- $uDhA
20 years ago
Missed out mentioning in the previous post:
Both tutorials are supposed to be working samples.
And the only difference I see is that the JavaRanch tutorial uses Struts 1.0.2 and the other tutorial uses Struts 1.1.
Thanks
-- $uDhA
20 years ago
Thanks for the response.
I removed the copy of struts.jar from java_home/jre/lib/ext directory.
After I did that, I get a new error now:

for the sample at
JavaRanch Tutorial
But after I did that, I could get the other sample at
Other Tutorial
working like a champ.
Thats crazy!! Any clues on that?
Thanks
-- $uDhA
20 years ago
hi pple
am a struts-beginner and i need some help on passing an Arraylist frm Action to JSP.
i cud use Session or request.setAttribute ( ) to get this done. but i am sure there is a 'struts-way' of doing this.
in the execute ( ) of SetUpMessageAction, i have:


i have a CategoryBean with int id, String description. in service.getCategories ( ), i do
repeatedly to populate the Arraylist.
from Action, request is fwd-ed to ContactPage.jsp, where I need to get the 'categories' collection to populate my combo box.
this is how i try to populate the combo box:


in my struts-config.xml, this is wht i have:

the exception i get is:


what does that mean? am i not setting 'categories' explicitly in Action? what am i missing here?
i had another question:

What exactly does this do?
thanks a ton.
-- $uDhA
20 years ago
thanks for the reply.
i shall try placing all the other jar files in the lib directory.
but the .war file that i downloaded frm the 2nd link DID indeed have all the files - when i extracted it. i wonder why even that gave me the same error!
any thoughts on that?
thanks
-- $uDhA
20 years ago
hi pple
i have an application written using JSPs and Servlets. my next step is to use Struts and modify it.
this is my first try at struts and tied to run my first sample application from:
http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts
am using struts 1.0.2, Tomcat 5.0.12
this is what i did:
i placed:
-- struts.jar in the C:\Tomcat_5.0\webapps\struts\WEB-INF\lib folder
-- all .tld files in the C:\Tomcat_5.0\webapps\struts\WEB-INF folder
-- servlet-api.jar and struts.jar in C:\j2sdk1.4.2\jre\lib\ext folder
i have a LoginBean.java, LoginAction.java and LoginForm.java from the URL. i have merely compiled them and placed them along with the
MessageResources.properties file in the:
C:\Tomcat_5.0\webapps\struts\WEB-INF\classes\test\struts folder.
i have placed LoginView.jsp and MainMenu.jsp in:
C:\Tomcat_5.0\webapps\struts\jsp folder.
i have reallly followed all the instructions!!
i started Tomcat 5.0 server and when i request for:
http://127.0.0.1:8080/struts/jsp/LoginView.jsp in my browser, i get the
following error message:


And i tried out another sample frm:
http://www.reumann.net/do/struts/lesson1
its the same error again.
so, what am i missing here?
i cant start my own stuff when i cant get a sample tutorial version working!
please help.
thanks
-- $uDhA
20 years ago