• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

'locking' forms

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a requirement have a web form editable by one group of users and locked for another group. I need advice on how to write a form that can be locked/unlocked and still conform to Struts (i.e. not code arround struts). This logic will be used on many other forms so I would like to avoid 'double' coding a locked and unlocked form.

I have looked at making the readonly attribute of the html:text a variable, but I could not get it to work (probably it is not possible). I am now looking at using the logic tag to switch between a read only html:text and an editable html:text. I could also use straight JSP to do this.

Can anyone think of better way to do this ?

Thanks for your help

Mike
 
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this article:
http://www.ibm.com/developerworks/web/library/wa-appsec/?ca=dgr-lnxw06ServletsTaglibsStrutsSecurity

We have done this (sort of) and implemented our RBAC-framework so that we can define on our custom secur tags what roles have edit and what roles has only read rights.
 
Michael Stains
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ove, thanks for your reply. However my security model is quite simple so I decided not to go down this route.

I discovered that it is not possible to do what I wanted with pure struts tags. But it is possible by mixing in straight html input tags which still get resloved into the returned Struts Form Bean. This is what I did:

<%lockForm = request.getAttribute("LockForm").toString();%>
...
<input name="SUPPLIERCODE" type="text" <%=lockForm %> value='<bean:write name="ListSupplierContactsRowBean" property="SUPPLIERCODE" />' class="dataChrBold" size="40" >

When LockForm = "readonly" the form is locked. when lockFrom ="" the form is updatable.

Mike
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic