Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

'locking' forms

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic