It's not a secret anymore!
The moose likes Other Application Frameworks and the fly likes Frontman 2.0 vs /WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Reply Bookmark "Frontman 2.0 vs /WEB-INF" Watch "Frontman 2.0 vs /WEB-INF" New topic
Author

Frontman 2.0 vs /WEB-INF

R Gonzalez
Greenhorn

Joined: Jan 11, 2012
Posts: 6
I've written a simple command that logs a user in and then forwards to a specific view, but when the forward ends with a error about not finding the WEB-INF command.
Plus i filter the request by the state of the session (inactive/invalid -> login, valid -> go on)
I don't know how to fix this problem.

These are my files:
web.xml

LoginCommand

And i receive this error:
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

What's the URL you are hitting?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

And this:
<servlet-mapping>
<servlet-name>CommandBroker</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>


is very, very wrong. This will route every request through the command broker. Even images and the like. Not what you want. Follow the patterns suggested. I use:
R Gonzalez
Greenhorn

Joined: Jan 11, 2012
Posts: 6
i want the url format to be /<contex-path>/command_name, not /<context-path>/command/command_name
do i have to write a specific filter that forwards each /command_name request to a /command/command_name request?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

You can't. How is the container supposed to differentiate command requests from other requests such as for CSS stylesheets, images, or scripts without its own mapping?

I'll never understand why people get so hung up on the format of URLs and the unreasonable control that they want to exert over them.

I suppose you could possibly write an over-complicated filter. But the whole point of FrontMan is to make command dispatching simple.
R Gonzalez
Greenhorn

Joined: Jan 11, 2012
Posts: 6
I wanted the url to be the most simple and readable possible. That's why i overcomplicate things
Maybe i'm understanding and using frontman in the wrong way...

Anyhow i came up with a filter (very simple, too) that verifies if the url points to a real path. if not, it forwards the request to /command/<requested-command> unless it already starts with /command
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Frontman 2.0 vs /WEB-INF
 
Similar Threads
Using a filter with frontman
servlet mapping clarification
how to initiate hashtable and linklist
JSF+Spring+Hibernate Session Problem
Error page configured in web.xml not working