Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Process Custom tag based on the given input from html (same page)

 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem in the below code.

index.jsp file


tld file



com.tcs.Test:-->class file process and gives the result as below

Some data processing and display as:
2010-08-10 10:43:28,666 +0100 DEBUG [LogService] - (139.71.139.42) :: 2010-08-10 05:48:24,640 :: dkeely4 :: keepAlive :: Keep alive sent.
2010-08-10 10:43:29,307 +0100 FATAL [LogService] - (139.71.139.42) :: 2010-08-10 05:48:25,343 :: dkeely4 :: keepAlive


Suggestion Please
Before I give an html input value "sname", the custom tag
<test:dateStamp1 before="${value1}"/> executes,and will provide the output.

Is it possible to input the data from html and then make the custom tag to process the output based on input.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want use javascript I know that is possible.

You will create an event that will change the value. You will have to create an input hidden, and at the input text you will use an event that calls a javascript function.

This javascript function will change the hidden attribute value, and you set this hidden value to the tag. [=
 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about using the JSTL c:if tag? I don't have access to my machine to test
<c:if test="${not empty param.sname}">
<c:set var="value1" value="${param['sname']}"/>
<test:dateStamp1 before="${value1}"/> ---->Custom Tag
</c:if>

I will try the javascript part.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. You cannot execute JSP mechanisms in the page as a result of client side actions. The JSP executes on the server to format the HTML page which is sent to the client, On the client the JavaScript is executed. The JSP never left the server and executed long before the JavaScript executes.

Please read this article to understand how JSP operates.
 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement where I need to process the logfiles based on the timestamp/agentId, if it matches I need to show the output.

logfile format:
2010-08-10 10:43:28,666 +0100 DEBUG [LogService] - (139.71.139.42) :: 2010-08-10 05:48:24,640 :: dkeely4 :: keepAlive :: Keep alive sent.
2010-08-10 10:43:29,307 +0100 FATAL [LogService] - (139.71.139.42) :: 2010-08-10 05:48:25,343 :: dkeely4 :: keepAlive

The logfiles in one folder has a differnet structure when compared to other.


My idea is to use customtags(corresponding .class ) and then process rather than embedding the scriplets/using servlets.Like the sample example above.

Please suggest I can proceed using customtags or not??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic