vasuma patel

Greenhorn
+ Follow
since Mar 07, 2006
Merit badge: grant badges
For More
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 vasuma patel

Try using getParameterValues("time")
17 years ago
JSP
I have a form where user picks some items from a list. In the next page the items he selected are displayed for confirmation.All these items are checked by default. He can uncheck some of the items here. I am capturing the items he chose from the confirmation page from the request. Buut since they are there in this page, my reuest is giving the same items even though they are unchecked. For exapmle if the name of the parameter is ITEM, my request.getParameterValues("ITEM") is returing all the items, checked or unchecked. How do I get only those items which are only checked?

Thanks in advance,

Vasuma
17 years ago
JSP
Bumping up for attention
18 years ago
I have a web application which is hosted in a very large application portal. I enter the home JSP of the application when I click on the left hand panel where the link to my application lives. Based on a parameter that I set in session I display res[ective JSPs. Problem is when in a JSP if I click the left hand penel's main application entry point I end up showing the JSP I am in rather than the home JSP of my application. It is because my parameter is set to that page. How do I set the parameter to tha home JSP's page from anywhere? I have links to home JSP from my other JSPs also - HREFs that should take me back to home JSP. They are also not working because my parameter is already set to the respective current JSPs.

Thanks in advance for any inputs. I am getting a lot of help here for any question that I have and appreciate it heartfully.


Regards

Vasuma
18 years ago
Ok.. Thanks. I was using getParameter() but am getting null and so thought there is something different to do with select. I will check what I was doing wrong.
18 years ago
How do I get the selected value of a dropdown box( HTML select) from request object?

Thanks in advance

Vasuma
18 years ago
I am thinking of writing a SQL where I group the results by category_id and have the count(items). This will be my outer loop. I will loop for count no. of times in each category to get items ( another database call) and store them in a map ( category_id is the key and beans of the items in each category in an arraylist). Does it make sense?
I have a jsp which displays items available in the database in groups of their category ordered by catageory name. Each category is to be in a table with heading of the category name in a bigger font. Items belonging to that category will follow in the table in a smaller font having other columns like itemId, an image thumbnail, description etc. Next table will have the next category and items of that category.

I have two tables in the database - an ITEM table which has a referential integrity with CATEGORY table on category_id. CATEGROY table will have the categoryId and category_name columns. category_name is what is to be displayed as the heading for each table in the form.

I have a bean which will have all these columns as fields. I query the database and populate the bean with the results from database. Now, I am at a loss on how to write the code for jsp. I am having an idea that I should have a for loop for each category under which there will be another for loop for items of that category but how do I get the results in the format of category and items of that category?

I wrote the sql for getting the itmes and categoris like this....


select itemid, image, description, category_id, category_name from ITEMS A, CATEGORY B where A.category_id = B.category_id order by category_name.
I can populate the beans from teh resultset but I am at a loss on how to organise the results in proper java collections objects for me to be able to use them in the jsp.

Request experienced people to throw some light.

Thanks very much for reading my lengthy post and thanks very much in advance for your ideas.

Vasuma
You are right. Thanks
[ March 19, 2006: Message edited by: vasuma patel ]
18 years ago
I have a form having some user inputs. When the form is submitted I an trying to get the user input values using getAttribute() method of request and they are always coming as nulls. When I tried using the getParameterValues method and get the first object of the resulting array I am getting the values.


Request experienced people to throw some light.

Thanks in advance.

Vasuma
[ March 18, 2006: Message edited by: vasuma patel ]
18 years ago
Thanks for the info. The error has gone after I restarted the App Server as suggested in the link.
18 years ago
I get a class cast exception on the same class. The exception message is

com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
Caused by: java.lang.ClassCastException: com/A/B/SelectionsBean incompatible with com/A/B/SelectionsBean

This appears really wierd to me. I did some serach and came with this which is close to my problem but didn't quite understand the isuue.

http://www.jspwiki.org/wiki/A2AClassCastException

Appreciate any inputs.

Thanks in advance

Vasuma
18 years ago
Hi, This may be straight forward and simple for most of you.

I have several check boxes in my page. I would like to check if there is atleast one of them checked by user. If not I need to show an error mesage. My jsp is dynamic and the names of the rows are not known beforehand. My rows come as <tr>s in a for loop based on a collection object which gives me all the details of the rows. How in my javascript function can I refer to the rows? And how do I check the number of ceckboxes checked?

Thanks in advance for any help.

Vasuma
Thanks very much.

So I need to have a bean which has the individual properties and getters and setters. In the servlet I need to access the database and populate the beans and send them to the JSP in a collection where jsp reads iterates through them and displays. User selections are a bunch of these beans as well which are put in the request and sent to the servlet where it is forwarded to the second page. The user data bean is populated by accessing the database and the populated bean is passed to the jsp.


Can I do anything different / better?

Thanks in advance.
18 years ago
JSP
This is a general application question, not necessarily JSP sepcific. I thought this belongs here but feel free to move.


I need to create a web app which has three pages.User is already known by the time he comes to my application. Home page displays a list of available materials ( A check box, an image and a descritpion in each row, several rows in the page). There are submit and clear in the end. User selects as many of the materials he likes and clicks submit. I need to store the sellections in the database which has the details of the quantities of the materials in tables.

Next page is a confirm order page where I display all his selections( check box, image and description again) and his shipping details in a table at the end. I get his personal details from another table. He is asked to make any corrections if needed. Once he makes any changes the confirm order page is redisplayed with changes. Next page is the thank you page where he is thanked and details of when he can expect the materials to arrive.

Now I am thinkng of using JSPs for the three pages. I am thinking about having two java beans one for the selctions and one for his personal details.

My questions are

Should I display home page by getting data directly from database? Should I populate beans and then get data from them?

I thought each row in database corresonds to a row. So should I have multiple beans populated for his selctions and put them in a map and send it in request? Or should I create a list of his selections and put it in the bean? In whcih case bean should have a collection?

I know jsps and servlets individually but never usded java beans. This is a small application in which I need to connect to DB, use beans and pass them back and forth.

Request experienced people to suggest a general flow to follow.

Thanks very much in advance.

vasuma
18 years ago
JSP