Understanding JSP custom tags and javascript...

Hi, I am a novice in JSP custom tags and I would like to learn in detail what the following lines of code is doing and what is happening b/c I am confused about the mixing of javascript, custom tags and <jsp:usebean> tags...:

<script language="JavaScript" type="text/JavaScript">
...
<control:iterator id="winFeature" collection="<%=tree.getData().getwinFeatures()%>">
      putWinFeatures("<jsp:getProperty name="winFeature" property="winId"/>", "<jsp:getProperty name="winFeature" property="winFeatureConcat"/>");
</control:iterator>
...
</script>


Thanks,
G.
gen228Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimYatesCommented:
The control: bit will be executed on the server (when the JSP is building up the HTML page to send to the client)

From the looks of things, it will loop round the elements in:

tree.getData().getwinFeatures()

and add a "putWinFeatures" javascript function call for each one...
0
TimYatesCommented:
then, this "built up" html page will be sent to the client...
0
TimYatesCommented:
And whatever "tree.getData().getwinFeatures()" returns, it is a class with at least 2 properties...

winId and winFeatureConcat

-- the methods called will be getWinId() and getWinFeaturesConcat()
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

gen228Author Commented:
Thank you TimYates!  I have been analyzing the code, I will get back to you!

Thanks,
G.
0
gen228Author Commented:
Hi TimYates, so from my understanding, <jsp:getProperty... can get any property on a jsp page and in this case, from the <control:iterator> custom JSP tag.  

Thanks,
G.
0
TimYatesCommented:
yeah...

the

<control:iterator id="winFeature" collection="<%=tree.getData().getwinFeatures()%>">

line stores the current bean from the loop in the variable called "winFeature"

then

<jsp:getProperty name="winFeature" property="winId"/>

calls "getWinId()" and

<jsp:getProperty name="winFeature" property="winFeatureConcat"/>

calls "getWinFeatureConcat()" on that object :-)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gen228Author Commented:
Thank you so much TimYates  !  Your explainations were very clear and excellent!  

Thanks again,
G.
0
TimYatesCommented:
Glad I could help :-)

Good luck with it all :-)

Tim
0
gen228Author Commented:
Hi Tim!,  I have the question thread: "java.lang.ClassCastException inside jsp..." http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21223807.html open.
If possible, can you take a look?

Thanks so much,
G.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.