Dashboard > WebWork 1 > WebWork CookBook > Skinning
  WebWork 1 Log In View a printable version of the current page.  
  Skinning
Added by Anders Hovmöller, last edited by Hani Suleiman on Apr 25, 2004  (view change)
Labels: 
(None)

A very usable feature of webwork actions is that they are location independant. This means that http://yourdomain.com/Foo.action will execute the same action as http://yourdomain.com/bar/Foo.action. The views you have mapped in your views.properties (or views.xml) are paths relative to where you executed the action (/ and /bar in the examples above). This feature can be used for skinning with a simple views.properties file like this:

Foo.success=foo.jsp
Foo.error=foo-error.jsp

Now in your web application you might want to have two different views for HTML and WML clients. Simply put a file called foo.jsp that outputs HTML in a folder called (for simplicities sake) "html" and another foo.jsp that outputs WML in a folder called "wml". Then all you have to do to access the html version is use the address http://yourdomain.com/html/Foo.action and to use the WML version do http://yourdomain.com/wml/Foo.action.

This method is good for skinning, supporting different browsers (you might want simpler layout for a PDA for example) and so forth.

Since the request path is /wml and the view page specified was relative, the acual view page that will be used will actually be /wml/foo.jsp.

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators