Could it be too bad to implement it as a tag?

R

Rhett Liu

Hi,Kind guys!

I'm in troulbe with a choice of custom tag.
The situation is:
I have some record stored in database,but not much records,just like a
catalog,less than 30,there's need to display them all in a web page as a
list,I want to write a custome tag to display them,fill them in a
<select><option></option></select>'s options;If I don't do like
this,however,I have to refill all them in to a java bean in a action
bean,consider that first we get it from an edit-action,next we submit it
to the save-action,if save-action fill and have to redirect back to edit
page,hear we have to refill all them in to a java bean(which is stored
in request not session,i think this is more suitable).
Which method should i do?One of my mates considers it is bad design,he
seems don't like write custom tag,it is dangerous,not clear!

How about your ideas?

Thanks
 
S

Sudsy

Rhett said:
Hi,Kind guys!

I'm in troulbe with a choice of custom tag.
The situation is:
I have some record stored in database,but not much records,just like a
catalog,less than 30,there's need to display them all in a web page as a
list,I want to write a custome tag to display them,fill them in a
<select><option></option></select>'s options;If I don't do like
this,however,I have to refill all them in to a java bean in a action
bean,consider that first we get it from an edit-action,next we submit it
to the save-action,if save-action fill and have to redirect back to edit
page,hear we have to refill all them in to a java bean(which is stored
in request not session,i think this is more suitable).

I'd use the html:eek:ptionsCollection tag and store the options (assuming
the list doesn't change frequently) in session scope.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top