Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Update JSP thru ANT  RSS feed

 
rajiv nair
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we update a JSP thru ANT ?.
More details ....
I get all the files from dimension to my Local drive using ANT . There is a JSP called about.jsp which has a date filed in mm/dd/yy . I want to update this date to the date when I create the ear file using ANT.
Is this possible?. The about.jsp will be in my local drive.

Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not keep the date in its own little text file, and then include that in the JSP file through <jsp:include>?

Ant can write to a file through its <echo> task.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant tasks that can replace parts of a file include

copy (with filters)
replace
replaceregexp

which one is the right for you depends a lot on the circumstances.

If you can change the original file, Ulf's suggestion using jsp:include sounds good, too.
 
rajiv nair
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf and Ilja...I will go with your suggestions.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!