• 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

actionforward

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firstly, i am using struts and struts-wml. The problem i'm facing with actionforward. I have 2 front ends one with WML and JSP. I have to create identical ActionMappings (and the actual action class) for both which i think is unncessary. The actual class contents are the same just the mappings that are defined in struts-config they point to either the jsp or wml version. Is there anyway i can remove the redundancy of having 2 identical action classes?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you could use condition to test whether u need to forward to WML or JSP and call the corresponding actionForward..

if(WML)
mapping.findForward("WMLpage");
else
mapping.findForward("jsppage");
 
spear spear
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah i initially thought of that but i couldn't find a way to know if it was a wap request. I tried .getContentType() but that just returns some information about the form...
 
spear spear
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
since i have all the my wml content in one directory is it possible to test based on the directory the user entered from?
 
spear spear
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe getContentType?? but that gives me:

System.out.print("Content:" + ((ServletRequest) response).getContentType());
java.lang.ClassCastException: weblogic.servlet.internal.ServletResponseImpl

tried:

System.out.print("Content:" + response.getContentType());

undefined for httpservletrequest
 
spear spear
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well i just figured i can share the same action class just the foward and edit pages are different. So the only thing that it duplicate is the actionforwards in struts-config
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"spear spear",
Welcome to the Ranch. We have two main rules 'round the parts. The first is 'Be Nice', the second is 'follow the display name rules'.

You can check out the display name rules here but I'll summarise for you:

We require display names to be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and fix your display name, since accounts with invalid display names get deleted.

thanks,
Dave.
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic