בעיית tiles

justme5

New member
בעיית tiles

שלום לכולם, למי שמכיר struts: כיצד ניתן להשתמש בתג <tiles:put> בצורה דינמית, כלומר: כיצד לגרום לקוד הבא לעבוד:
<tiles:put name="body" value="<%=body%>" type="string"/>​
בהנתן body="/path/on/disk". תודה.
 

DarkSwell

New member
פשוט לכתוב אותו..

עליך להגדיר את body כ String לפני כן ואין שום סיבה שזה לא יעבוד.
 

justme5

New member
עובדה שזה לא עובד...

האם יש חשיבות לסדר הקומפילציה (התג או המשתנה)?
 

DarkSwell

New member
עדיף להגדיר משתנים לפני השימוש בהם.

שלך את הקוד וניראה.
 

justme5

New member
קבל

<% String body = (String)session.getAttribute("Body"); System.out.println("body="+body); //there is valid value in this value %> <tiles:insert definition="user_layout"> <tiles:put name="body" value="<%=body%>" type="string"/> </tiles:insert>​
מה שקורה זה שהדף עולה ריק.
 
למעלה