Bonjour,

Je cherche comment passer un bean message struts sous la forme d'une string dans un custom tag.

voici mon code (dans la jsp) à transformer en custom tag

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
<span id="strongitem">
<bean:message key="cle.message" />
</span>
Voici ce que j'ai fait :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
public int doStartTag() throws JspException {
 
			try {
				JspWriter out = pageContext.getOut();
				out.write("<span id=\"strongitem\" >");	
 
			} catch (IOException e) {
				throw new JspException("I/O Error", e);
			}
			return(EVAL_BODY_INCLUDE); // Include tag body
		}
 
		 public int doEndTag() {
			try {
				JspWriter out = pageContext.getOut();
				out.print("</span>");
			} catch (IOException ioe) {
				System.out.println("Error in HeadingTag: " + ioe);
			}
			return (EVAL_PAGE); // Continue with rest of JSP page
		}
Je n'arrive pas à récupérer la valeur de clé du message (key="cle.message") qui est dans un fichier de type ApplicationRessources.properties.

Merci pour vos lumières