aspose file tools*
The moose likes JSP and the fly likes Process Custom tag based on the given input from html (same page) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Process Custom tag based on the given input from html (same page)" Watch "Process Custom tag based on the given input from html (same page)" New topic
Author

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

dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 98
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

Joined: Jul 14, 2010
Posts: 754

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. [=


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 98
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 98
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??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process Custom tag based on the given input from html (same page)