1. I have a simple application, which uses a html table to represent the data retrieved from the database.

How can I add to each row from the Html Table, a submit button.
The button can be something like delete or modify the dates from that specific row, so I need to take some parameters from the row.

2. I have another question.
When I start the application, the app should querry the database, and show me the record, but the HTML table is empty. I need to press a button (which is mapped in web.xml) to see something.

How can I see the records from the first time?

Edited by TryingToDo: n/a

9 Years
Discussion Span
Last Post by TryingToDo

1. Post num 10 is something what you may want to have look at

2. create empty index.html (*.jsp) with meta tag for redirect in one second that will call upon your servlet. <meta http-equiv="refresh" content="1; url=next_page.html">


Thank you Peter!

P.S. BTW, your JSP tutorial helped me a lot! :)

It is not 100% bullet-proof solution, but it was intended as kick-off example as we been little tired of continues request "how do I connect JSP to database" or similar. Glad you found it useful.


1. First problem:

Enumeration en = request.getParameterNames();
			String name = (String) en.nextElement();
			System.out.println("Retrieved name is "+name);
			String value = request.getParameter(name);
			System.out.println("Value is " + value);

This destroyed me :).
When I evaluate the parameters (before calling request.getParameterNames(); ) which are send from the jsp, they are null, but here the same parameter it's shown as not being null. :)
For the moment, I will not use "a submit button for every row". :)

2. Second problem:

Could you give more details?

I have one jsp file: tesla.jsp

I created the index.jsp, in which I put

<meta http-equiv="refresh" content="1; url=tesla.jsp">

but I don't see the results.

Do I need to do something in web.xml?

Edited by TryingToDo: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.