Create output diff report in a particular directory in WebApp

21 views
Skip to first unread message

vaibhav shukla

unread,
Oct 22, 2013, 3:06:06 AM10/22/13
to dais...@googlegroups.com
Hi All

I am trying to create the html diff report in a particular directory inside my webapp.
I tried modifying the main class line #37, to something like  getServletContext().getRealPath("/")+"/diffreport/daisydiff.html" .

But it throws me an error saying :

..(Location of error unknown)javax.xml.transform.TransformerException: java.io.FileNotFoundException: Users/vshukla/Documents/softwares/apache-tomcat-7.0.42/wtpwebapps/PBSkyScraper/diffreport/daisydiff.html (No such file or directory)

done


I am calling this main method from servlets and passing the context path as a separate parameter.

Can someone please suggest me a way to create the diff report inside a directory.

Thank you!

Kostis Kapelonis

unread,
Oct 22, 2013, 8:29:48 AM10/22/13
to dais...@googlegroups.com
Creating a file inside your application server is a really bad idea
for a lot of reasons. Are you sure that you want to do this?

The suggested way is to create a file response dynamically and send it
to the web browser (without actually saving the file on the server).
Daisydiff reports are already html
so the web browser can show them as is.

However you need a lot more changes on DaisyDiff code than just a simple line.

Kostis
> --
> You received this message because you are subscribed to the Google Groups
> "DaisyDiff" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to daisydiff+...@googlegroups.com.
> To post to this group, send email to dais...@googlegroups.com.
> Visit this group at http://groups.google.com/group/daisydiff.
> For more options, visit https://groups.google.com/groups/opt_out.

vaibhav shukla

unread,
Oct 22, 2013, 11:13:16 AM10/22/13
to dais...@googlegroups.com
Actually the requirement is to keep track of the reports so I thought saving the HTML reports would be only option with me.
I know at some point in time, the server would really be heavy loaded with files but as of now, for just a start, I am trying this only.

As an admin, in future if i need to go back to a previous day report, I should be able to that by checking server directory. Thats the aim and hence such implementation.

Meanwhile, I would love to have some suggestions on this from your side as well.
Thank you!


You received this message because you are subscribed to a topic in the Google Groups "DaisyDiff" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/daisydiff/wrBZBLMM3Gc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to daisydiff+...@googlegroups.com.

To post to this group, send email to dais...@googlegroups.com.
Visit this group at http://groups.google.com/group/daisydiff.
For more options, visit https://groups.google.com/groups/opt_out.



--
best wishes!!
 Vaibhav

Kostis Kapelonis

unread,
Oct 22, 2013, 5:42:47 PM10/22/13
to dais...@googlegroups.com
Ok. Ι understand. But this problem again is mostly unrelated to
daisydiff. (This mailing is for daisydiff discussion, not general Java
questions)

I would start with a search in stack overflow like "create file in web
server" or something similar.

Work gradually.
First write code to save a simple text file on the server (and
retrieve it later), and then go to DaisyDiff output.

Kostis

vaibhav shukla

unread,
Oct 22, 2013, 11:38:08 PM10/22/13
to dais...@googlegroups.com
Actually I was able to achieve this requirement. I thought that there might be some glitch inside daisydiff code which might be coming in way, but nevertheless, I am successfully able to implement the desired feature.

And yes, that has nothing to do with DaisyDiff. Sorry for asking such questions here, and thank you for your help.
Reply all
Reply to author
Forward
0 new messages