• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Front Man Examples?

 
Greenhorn
Posts: 13
Tomcat Server Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks, Mike.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure, what do you need an example of?
 
Mike Heffelfinger
Greenhorn
Posts: 13
Tomcat Server Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks, Mike.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, interesting. I hadn't thought about including a sample skeleton application. That's a good idea.

Front Man 2.0 is in the works... maybe this is something I'll include.

In the meantime, any "spot" examples you need?
 
Mike Heffelfinger
Greenhorn
Posts: 13
Tomcat Server Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Mike
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the example above you do a servlet forward. How about the PRG (Post-Redirect-Get) pattern? Would that be as easy in FrontMan?

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Absolutely. I'm a big fan of that pattern and use it often.

The example above is a page controller and forwards to its view.

Within a task controller, a statement such as the following would be used to redirect to the page controller of the next view:



in place of the forwardToView().
 
Per Lindberg
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks promising, Bear! A minimalistic skeleton webapp of "Hello World" flavour (showing PRG) would be most interesting, and will surely help sell Front Man.

Like you, I'm not enthusiastic about all these bloatware frameworks that just add more complexity and little else.
 
Mike Heffelfinger
Greenhorn
Posts: 13
Tomcat Server Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to report that I've been using Front Man and it's working great. I'd post a link to my website which uses it, but it's a work in progress.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool! Nice to hear that its working out for you, Mike!
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks in advance.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Scott Huffman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could give it a whirl. What changes/features do you have planned for the new version? Why did you set out to rewrite it?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Version 2 is not a rewrite, just an update. See: https://coderanch.com/t/489024/ba/Wanted-Front-Man-beta-testers
 
Mike Heffelfinger
Greenhorn
Posts: 13
Tomcat Server Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frontman is still working great for me. Here are two of my websites which use it:

Tech City Systems and NASA Review.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too cool, Mike!
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic