This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Groovy and the fly likes Grails and Excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Grails and Excel" Watch "Grails and Excel" New topic
Author

Grails and Excel

cj pangilinan
Greenhorn

Joined: Dec 22, 2006
Posts: 9
Hi Glen and Peter,

I have an application that do motly excel parsing. It is currently written in jsp+ servlets. Can you guide me how to migrate my application in grails. One of the problems I see is the excel part. DOes grails have API in Excel files processing. Getting the number of sheets for example, using ajax to prompt the user the available sheet names. Something like that. I hope you can give me at least an overview or a step by step guide. Thanks.
Vikrant Pandit
Ranch Hand

Joined: Mar 27, 2006
Posts: 245
cj,

Why do you want to migrate ? Grails is a domain model centric framework. From your description it does not look like your application has much of a domain model. In case you just want to dabble in the technology, see getting started guide on groovy site or you can follow "Mastering Grails" series on IBM developerworks site


Vikrant Pandit
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

DOes grails have API in Excel files processing.


Groovy is build on Java, and can use existing Java libraries. So if you currently have servlets and JSPs that use a Java API to process Excell documents, then you can do the same with Groovy. Look in the Groovy documentation on how to access Java classes. (Grails is basically a web framework for Groovy.)


JBoss In Action
cj pangilinan
Greenhorn

Joined: Dec 22, 2006
Posts: 9
Thanks for the answers. I just want to know grails and while learning, i want to use my existing application as a sample.

So if I use the Excel API that I am using in Java, I have to code in Java also? or Is it better to use Groovy?
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Actually it will be the same code!!! but in Groovy you might be able to use certain features to reduce the complexity

Ref:
http://josh-in-antarctica.blogspot.com/2008/03/grails-excel-file-upload.html
http://josh-in-antarctica.blogspot.com/2008/03/grails-excel-file-download.html


===Vyas Sanzgiri===
My Blog
Peter Ledbrook
author
Greenhorn

Joined: Jul 15, 2009
Posts: 25
Hi,

I'd just like to back up Vyas' answer. If you have an API in Java, you can very easily use it from Groovy too. And remember that almost all Java code is valid Groovy.

Cheers,

Peter
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

What is the "almost" for?
Peter Ledbrook
author
Greenhorn

Joined: Jul 15, 2009
Posts: 25
Unless things have changed recently, Groovy is missing:

1. support for anonymous or inner classes
2. the do...while loop
3. support for multiple variables in the standard Java for loop.
4. character literals

Character literals should work as string literals in most cases, since Groovy will coerce the string to a char. It wouldn't surprise me if there are some cases where that coercion doesn't occur.

Cheers,

Peter
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Good that you told me. Never knew about these things!! I always though all Java code works
 
wood burning stoves
 
subject: Grails and Excel
 
Similar Threads
What does Groovy/Grails offer?
GRAILS:A Beginner
SSL implementation in struts
* Welcome Jon Dickinson
Why is 'Grails 1.0 Web Application Development' better?