wood burning stoves*
The moose likes Servlets and the fly likes Text file file reader in real time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Text file file reader in real time" Watch "Text file file reader in real time" New topic
Author

Text file file reader in real time

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430



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

Joined: May 03, 2001
Posts: 163
Look at comments from Albareto McKenzie


I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
Hi Anoop, why do you need Spring and not a normal Servlet that extends from HttpServlet?
Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
Sure but the question was to use Spring so I explained it.
Normal Servlet is enough
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
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

Joined: May 03, 2001
Posts: 163
I think spring gives more freedom with its MVC support.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

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

Joined: Oct 02, 2005
Posts: 430

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Text file file reader in real time
 
Similar Threads
Indexed text files
text/html & text/plain
style guide
text/plain & text/html
EJB 3.0 in Action examples in Eclipse