• 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

Struts Design decision

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Requirement from the customer : Multiple Device Support provision in the presentation layer.They suggest the following approach using xml/xsl
Controller servlet > Action class > DAO
when an xml string is returned from the DAO,action class uses xml/xsl tranfomer to html.

1.Can struts still be used here and what features of struts and JSP will in loose out here.
2.Will there be .JSP pages in the approach as I see html is generated by the transformer
3.Can struts alone as the presnetaion layer framework ,still catering to multiple device support,without xml/xsl.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I were starting a project that required support for multiple devices, I'd use JSF. JSF has good separation between the content being displayed and the way it's being displayed. By using different rendering kits, you can display the same control on two different devices. The only down side of JSF is that it's still a relatively new technology and you may not be able to find a rendering kit for the specific device you need to use. You may end up having to write some of this low level code yourself.

If your client has already made up their mind about using XML/XSL, then I guess there's not much you can do about it, but I'd really push for JSF if their minds are still open.

If you do go with XML/XSL, You can certainly handle the page navigation with Struts. You won't be able to use the Struts custom tags, though, or make much use of the ActionForm.
 
raj joe
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Merrill Higginson:
If I were starting a project that required support for multiple devices, I'd use JSF. JSF has good separation between the content being displayed and the way it's being displayed. By using different rendering kits, you can display the same control on two different devices. The only down side of JSF is that it's still a relatively new technology and you may not be able to find a rendering kit for the specific device you need to use. You may end up having to write some of this low level code yourself.

If your client has already made up their mind about using XML/XSL, then I guess there's not much you can do about it, but I'd really push for JSF if their minds are still open.

If you do go with XML/XSL, You can certainly handle the page navigation with Struts. You won't be able to use the Struts custom tags, though, or make much use of the ActionForm.



Merrill

My client is stuck XML/XSL.I just want to know how do I use both Jsp and XML\XSL.Can a jsp page with some static html content,JSTL tags,struts tags and XSL tags be displayed on a mobile device without any issues.

Is it better to have seperate jsp for diffrent devices/clients.

How do i handle pagination in the above case with XML/XSL and JSP?
[ June 05, 2006: Message edited by: raj joe ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raj,

If you're going to use XML/XSL, your JSPs will likely consist of only a single <x:transform> tag to match up the XML content with the XSL template and render it.

As I mentioned before, if you use this approach, you won't be able to use Struts tags at all. Struts tags generate strictly HTML. Since you also want to generate WML (or who knows what else), you're not going to be able to do it with Struts tags.

In your XSL template, you can certaintly specify a struts Action as the action of a <form> tag. That action can call whatever back-end processes need to be called to generate the XML and can navigate to a JSP with the <x:transform> tag to render the output. Also, as long as you name your imputs appropriately, Struts can still populate an ActionForm for you. You'll get no help from Struts, though, when it comes to creating the XML or the XSL templates.

For each panel, you will want to have two different XSL templates: one for HTML and the other for WML. Since all the JSP does is match the XML with the XSL, you could use the same JSP and have it use either the HTML or WML templates depending on some varialbe indicating the type of output expected.

I'm really no expert on this, but I hope I've at least given you a few ideas. Good luck.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I recall back when the XML craze was fairly new (I guess this was the late 1990's) that this was how web application were going to be written. The server would return meaningful XML data back to the browser and the browser would apply a stylesheet to transform the XML into HTML. I can remember playing around with a few demos, but I recall that the XSLT support of the browsers of the day was pretty spotty and not consistent. This style of development never caught on.

I suppose that you could push the transformation onto the server so at least you would not be dependant on the brower's support. I also imagine that you could generate the XML, apply a transformation that would produce a JSP page and then get your servlet engine to execute the JSP file, but I would not know where to start with this approach.

I am mostly just rambling here because I do not have experience in this area. I would research other mobile solutions and see what others are using. It is hard for me to envision Struts fitting into the solution, but maybe.

- Brent
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic