开发者

Show versions in .jsp pages

I need to put versions of my software in my jsp pages. Can I开发者_StackOverflow社区 do it trough XML files? Can Subversion record this in files that has been versioned?

thankful

Daniel Alves da Fonseca Maciel


Subversion keyword substitution might do the trick, for example, add something similar to in each of your jsps:

<!-- 
$LastChangedDate$
$Rev$
-->

Then everytime you commit, svn should replace the $keywords$ with the appropriate value. See the svnbook for more details.


To create version number that is same across all the JSP pages.

  1. Have your build process create a file that contains the version number.
    • execute something like this in your build: svnversion -c trunk > version.txt
  2. Package version.txt with your web application (inside .war file).
  3. Create a function to read version information from the version.txt file
  4. Call function from JSP pages and display version information. (Preferably from some footer/header fragment that is included in every page).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜