Reputation: 2599
I'm developing a web page containing a list of existing java class name :
so when the user click the link of the java class name a new web page is opened containing the code of this java class . so to do it i will use a flow to read the file (java class) and write it on a web page . Have you another optimized solution ?
Upvotes: 0
Views: 802
Reputation: 3880
There is a new project called back2Code, which will decompile class files back to source code.
http://code.google.com/p/back2code/
Upvotes: 2
Reputation: 94653
Use <c:import />
JSTL and embed the content in <pre></pre>
tag.
<c:import var="content" url="File.java"/>
<pre>
<c:out value="${content}"/>
</pre>
Upvotes: 4
Reputation: 668
For each java class generate a static html page and on click simple open that page.
Upvotes: -2
Reputation: 7905
Just read the .java file like any other text file. Note make sure you are doing it with the .java files and not compiled .class files.
You can then optionally format it.
Upvotes: 3