Results 1 to 3 of 3
Thread: Help with Tags JSP
- 07-04-2007, 02:47 PM #1
Member
- Join Date
- Jun 2007
- Posts
- 92
- Rep Power
- 0
Help with Tags JSP
Under WEB-INF/tags directory there is a file called select.tag.
I viewed the filed and found there are some lines of java codes wrapped within the
My question is: why use "!" after theJava Code:<%! %>: <%! ... try { Object bean = jspContext.findAttribute(beanName); Method m = bean.getClass().getMethod(methodName, null); result = m.invoke(bean, null).toString(); ... %>Thanks.Java Code:<%? Why not directly use <%.... %>>
Marcus :cool:
- 07-04-2007, 02:50 PM #2
Senior Member
- Join Date
- Jun 2007
- Posts
- 111
- Rep Power
- 0
JSP, not client-side javascript.
Please check this link
Greetings.
Eric
- 07-04-2007, 02:53 PM #3
Member
- Join Date
- Jun 2007
- Posts
- 91
- Rep Power
- 0
s referred to as a declaration block.Java Code:<%! ... %> i
it can also be written in xml syntax...for example
the following is a commentJava Code:<jsp:declaration> String user_name = new String(); </jsp:declaration
the following is an expressionJava Code:<%-- comment --%>
Say for example, you have a string and it contains a user's name "John Smith" and you want to print it...you can writeJava Code:<%= expression %>
GreetingsJava Code:<%= name %> instead or typing <% out.println( name ); %>
Daniel:o


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks