ofortuna
ofortuna

Reputation: 187

how can i make a JSP tag attribute's value dynamic

Please suggest,how can I make "catalog.xml" dynamic

 <XML:parsexml  resource = "catalog.xml" toXMLObjName = "XMLDocument" >  </XML:parsexml> 

Upvotes: 1

Views: 218

Answers (2)

Ramesh PVK
Ramesh PVK

Reputation: 15446

Check if resource attribute in parsexml tag supports Runtime and EL expressions. If it supports you can pass runtime values like this:

<XML:parsexml resource="${param.contextFileName}" toXMLObjName = "XMLDocument" >  
</XML:parsexml>

Where, ${param.contextFileName} is EL expression which resolved to the contextFileName request parameter.

Upvotes: 2

ofortuna
ofortuna

Reputation: 187

I did a bit research and did the following which solved the problem---

"${sessionScope.fileName}" 

instaed of

"catalog.xml"

Upvotes: 2

Related Questions