• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts tag from java code

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering I would like to call the same functionnality than the struts tag

directly from inside my action class (in my java code). The idea is that I would like the html to be generated right away to be able to access it from the java code. I have a couple of form widgets to print like that and I dont want to write it by hand
Anybody knows how to do this??
Thanks!
[ March 10, 2004: Message edited by: Bruno Dery ]
 
author
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tags write the html directly to the Servlet output Stream. Even if you manually invoke tag.doStrartTag(), you will not get a hold on the generated html.
Honestly I cannot think of a scenario, where you want to access the presentation in Java code. Normally you would access the model for the presentation and invoke decision logic in the Action Java code.
 
Bruno Dery
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I realize it was probably hard to grasp what is the problem I'm facing, so here goes.
Ok what I want to do is to have a form where I have a sentence where I'll replace certain key parts with form widgets. I have a string in a resource bundle like this :
For {1}, what is the {2} of {3}.
Now I want to replace 1 2 and 3 with combo boxes. The idea is to be able to translate the text in another language and simply have to translate the form text also into the resource bundle to have the form in the appropriate language. My combo boxes will need the translated text to be shown also.
So the thing is how do I :
1- Create the combo with the list of translated text?
and
2- How can I put this into the message above using message format or something similar?
This is like a two step message formatting. You understand now?
Thanks again!
 
Bruno Dery
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody can help me with this?? Thanks!
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic