• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text file file reader in real time

 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi all,

I would like to write a utility that will allow me to view some text files in a browser. I usually logon to the server to view the log files. What i would like to do is just load a browser and view the files in real time. The files are usually quite large so i only need to view maybe the last 2000 lines on every update

I am thinking that this is quite possible using probably Spring/Struts and Ajax. All i need is a head start on how to do it. Does anyone know of any examples or tutorials that can point me in the right direction?


Thanks
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at comments from Albareto McKenzie
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anoop, why do you need Spring and not a normal Servlet that extends from HttpServlet?
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure but the question was to use Spring so I explained it.
Normal Servlet is enough
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok! I understood the question in other way. I agree with you that normal Servlet is enough (and more than enough) for doing this

Regards.
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think spring gives more freedom with its MVC support.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Albareto McKenzie wrote:Hi Anoop, why do you need Spring and not a normal Servlet that extends from HttpServlet?

Why not make things overly complicated just because you can?
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Bear I understood your Sarcasm & I think to an extend I deserve it.
I must have given an easy solution to him than explaining Spring MVC.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not a big fan of making a simple task complicated just so you can use the latest buzzword tool.
 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for all your responses.

I know that this can be done without using any framework. The reason i want to use Spring or Struts is that i think that it will give me a good foundation for if and when i decide to extend it to do more things in the future.

What i have experienced is that in most cases i usually tend to update or upgrade most of my utilities. Using a framework makes this awfully easier. I agree it is probably more work to start with but it simplifies managing and maintaing it in the future.

For example, if i decide i want to include a use case for viewing user statistics on the site i think it would be much easier to update it if struts or spring was used. Im not saying that its not possible with plain servlets and jsp but i think it will be more manageable if a MVC framework was used.

Ofcourse some of you might argue you dont need Spring to implement a product that adheres to the MVC styles. But then again why re-invent the wheel?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic