I'm new to Java web programming and have been looking at some application frameworks. Two that look interesting to me are Stripes and Front Man, mostly due to their low overhead and simplicity. I'd really like to get something going with Front Man, but I need an example or two to get started ... does anyone have any?
A simple app will do; one that uses a front controller, does a little processing and returns a view, and that includes a deployment descriptor.
Maybe a starting page with just a text field and submit button. The user types some text in the text field and clicks the submit button. The application handles the post and returns another view to the browser that displays: "This is the text you submitted: submittedText".
Alternatively, Ben Souther has an example (Simple Command) of a front controller type application that's a little more complicated than what I described previously, but I don't believe it uses Front Man. Something similar to that using Front Man would be nice.
Yes, a skeleton app would be nice. Right now I'm stuck, and any small example app would probably save me hours of trial and error. I'm coming from a mod_perl/Mason environment where I used a front controller pattern, but the differences between Perl/Mason and Java has me stumped.
I'm not sure I understand what you mean by "spot" application, but anything will do.
Well, if its the whole Servlet/JSP environment that's unfamiliar to you, a few Front Man spot examples aren't going to be very enlightening, but for what it's worth:
Here's the servlet and mappings from one of my deployment descriptors:
and the skeleton of a Command implementation:
And that's about it for Front Man penetration. It takes care of the whole Front Controller thing. The rest is up to the Servlet and JSP environments (which is exactly Front Man's point -- don't try to re-invent the wheel like the big frameworks do).
A long long time ago I wrote a few web apps using the original Struts Framework. I am now having to port a ruby on rails application to java because RoR is not approved by corporate. I want to go bare bones and love your solution however I have a couple questions to start with. 1. What is the status of FrontMan2? Is there a site for it yet? 2. How would you incorporate property files for populating rendered html with values from property files based on keys and selected locale? 3. How do you gracefully intercept a request that is missing a verb (http://domain/contextPath/command). 4. How would you route root domain request to a command?
1. It's in beta. Care to give it a whirl?
2. Not sure what this has to do with FrontMan.
3. An exception will be thrown that you can handle in any manner that you like.
4. Configure it in the deployment descriptor like any other start URL.
For questions 2 through 4, the answer is that FrontMan doesn't get in the way of doing things the "normal" way. You don't have to do anything different just because you are using FrontMan.