Sue Temple

Greenhorn
+ Follow
since May 01, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Sue Temple

Sorry about a duplicate answer, but you just beat me there, Jesper - I did not see your post when until I hit submit!
12 years ago
It is because you are initializing the object within itself - when you create a car, it tries to create another car, that tries to create another car and goes into a recursive loop.

Move this code to to test()

12 years ago

Please look at HttpSession in the javax.servlet.http package

To read from a URL, look at the java.net package.

Here are a couple of examples - URL Example,
Example 2

If it returns XML, you can check if its well-formed. But I am not sure how you can check for css and broken links.

Section 15.9. Queries by natural identifier - Hibernate Guide
If your sql works correctly, please ensure that you have the mapping classes right

Hql -
The outline holds good for Struts1 as well, with some syntax change.

Struts 1 Hello World

12 years ago

Try to tweak this, I am guessing this will do it -

12 years ago
JSF



will print 00055.

Is this what you need?
12 years ago
JSF
Add a printline to your catch block and you will see what went wrong -

Replace:


with:
12 years ago
You should not need to do pass any values explicitly - Struts takes care of that for you.

Here is some pseudo code -

JSP:


struts.xml:


InventoryBean:


There are several examples online - I found this when I searched for one now - Struts2 CRUD Example

Hope this helps.
12 years ago
Of course, it is possible. But if you want your JSP to be doing the write operations to the database, why do you need Struts? That is very bad coding practice. Please look at one of the Struts tutorials to get started.



12 years ago
Your Tomcat error log has this -




Can you check if your code is closing all db connections after completing each database-related call


12 years ago
I use the code snippet below to iterate over a List all the time.

To quote from Struts Guide, "Iterator will iterate over a value. An iterable value can be either of: java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map, array."

Action class has

Form bean has:


JSP:
12 years ago
You may not need an arraylist to be passed for something like gender. It can hold one of two values at all times anyway.

Here is some skeleton code:

JSP -



Action class -


Person class -



Hope this helps.

Sue





12 years ago