Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating form elements at run time in jsp

 
rachit agr
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am creating an application where for each user form elements being displayed could be different
(type of element, number of element, label of the form element, order of appearance : all these could differ from user to user).
I am fetching these user prefernece from DB.
I was hoping to implement some technique/tool/method so that I could create the JSP to be shown to the user at runtime from centralized framework
(I want to reuse the same component for creating JSP for the users).
Any suggestions?
PS : I am using Struts + Spring Framework.
 
Harsha Ka
Ranch Hand
Posts: 45
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A way of doing this would be to create distinct groups/names for the different user experience and map this in your user preference table. In your action class fetch this value, set it as request parameter and forward the control to the JSP, where suitably using the conditional tags, create form elements based on the user group name.
 
rachit agr
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question is related only to the rendering part of the form elements.
I dont want to use conditional tags and render the elements.Because this rule is followed for several pages in my application. I want to have centeralized mechanism for this,
 
Yogesh Lonkar
Ranch Hand
Posts: 94
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on some thing similar situation, what we are doing is we have made one addition property for user which is called Role, and it is stored in DB there can be various roles for users,
so when you create user you assign him a role now there is 1 more transit Entity which assigns action to certain roles and you can use interceptor to check action against role from data base.
like wise you can customize your pages to be displayed to user depending on user's Role
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic