This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

controller dynamic tag  RSS feed

 
Yong Bakos
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was wondering if anyone would like to discuss their approach in maintaining mvc separation and how you handle some nice dynamic features in the view that are dependent on model data.

Let's say your JSP contains a custom tag that renders a select-list. The select-list defaults to a certain item depending on the previous (for one <option> in the list, one is rendered as <option selected> .
 
Yong Bakos
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[whoops. continued...]

previous user request. For example, if the tag first renders

<select name="preference">
<option></option>
<option>Ale</option>
<option>Amber</option>
</select>

And the user selects "Ale," what do you do with that data in the request so that the custom tag can render

<select name="preference">
<option></option>
<option SELECTED>Ale</option>
<option>Amber</option>
</select>

in the jsp that handles the response?

Do you set a session-scoped variable, a request-scoped variable?
If you have a lot of these in a jsp, do you use an object to hold this data?

Cheers,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!