• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Struts Convention/Rest Plugins

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have been getting to grips with struts again which is something I've been doing for a while lol I have an issue, perhaps somebody could enlighten me. I decided that after understanding the concept of XML configuration I would attempt zero configuration. First off zero wasn't to bad, instead of a struts.xml I had a struts.properties which set constants for struts configuration. This was all ok. I integrated Hibernate with a MySQL database and developed a page which pulled some data out of one of the MySQL test databases and presented in an iterable table on a .jsp. I also messed around with jquery plugin and datatables, all ok. I then decided that I wanted to understand more about user authorisation so I thought I would create a simple login etc as you do. I wanted the login form to be presented at http://localhost:8080/test/login with no action extension configurable with a constant. I got to grips with the convention plugin scanning package names and classes that extended ActionSupport.

The problem I had was that I could not seem to figure out how to render a .jsp with the form on at http://localhost:8080/test/login then submit that form using the same action but a different method. As execute would have given a success result which sent the user to /test/login. I read the struts website about post back default but I was unable to get that working, Im not sure why. So I read on stackoverflow that you could do it but that the only other way of achieving this was to use the struts rest plugin. So off I went down that rabbit hole. Downloaded the sample application and got to grips with that and now I have a login form at test/login. But I had to revert to using a struts.xml due to global allowed methods.

The next hole that I want to go down is to look at security for the login but I don't like the idea of using spring security with struts seems backwards why not just go and use spring or is struts better than Spring. Spring seems like another headache after the headache getting this far with struts.
 
Saloon Keeper
Posts: 5911
152
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts is just an MVC framework, while Spring these days is everything and the kitchen sink, including an MVC framework and a security framework. If this a new project I would advise to omit Struts entirely, and use Spring MVC. Struts is rather long in the tooth these days, and not really progressing technologically.
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!