grails

Why Java Web Service Client (CXF, JAX-WS, JDK1.6) Exhibits Different Behavior in Grails app? A CLASSPATH fix?

BACKGROUND: Current Grails application has to interact w/ a 'legacy' web service from a third party vendor - (systinet) Used the Apache CXF Wsdl2Java tool to generate complex types and service interfaces. Pretty standard stuff so far and this works perfectly from Java. After writing some test classes and main() methods to exercise th...

Rewriting URL for the default action in controllers

I'm having trouble rewriting URL's in Grails: I've got 2 controllers BlogController and ProjectsController each with a default def index = { } and matching view. Now when I create the following links: <g:link controller="blog">Blog</g:link> <g:link controller="projects">Projects</g:link> They get translated to http://localhost:8080/...

Groovy, How to do 2 phase commit? Is Sql.withTransaction can manage transaction scope accross multiple databases?

Hi there, Well, I think my question says it all. I need to know if Groovy SQL supports two phase commits. I'm actually programming a Grails Service where I want to define a method which does the following: Get SQL instance for Database 1, Get SQL instance for Databsae 2, Open a transaction some how: Within the transaction call two dif...

Grails <g:actionSubmit> redirects to GSP instead of action

I have created a new action called "updateWithHistory" on a controller "X" similar to update. When I use this code from a scaffolded edit.gsp page: <span class="button"><g:actionSubmit class="save" action="updateWithHistory" value="${message(code: 'default.button.updateWithHistory.label', default: 'Persist')}" /></span> I get a 404 er...

Grails + GWT - using the same Date Format

I am developing an app using Grails and GWT for a client side. I want to use the same date format both on the client side and on the server side (preferably defined in one file). So far i've understood that Grails got it's own mechanism for internationalization (grails-app/i18n). I know i can access these messages from any server code u...

How do you authenticate a Wordpress front-end against a RESTful Grails-driven backend?

I'm developing a Software as a Service offering that other developers can use to integrate into their own sites running on Wordpress (and eventually other platforms). The backend will run on a set of REST webservices using Grails. I want to create a set of Wordpress widgets that can automatically hook in to my web services. The wordpres...

Problem accessing params.id in the filter

I need to create a filter that is triggered on any save/update action in order to record the history of whats being done. I am having a problem getting id of the object that is being manipulated. My controllers simplified: class FooController { static allowedMethods = [save: "POST", update: "POST", delete: "POST"] def save = ...

Not Saving Domain Object with Grails Searchable Plugin

Is it possible to use the Searchable Plugin to create an index of objects and never actually save the objects to the database? ...

grails portlet FlashScope

I am using def liferay_portlet_private_session_attributes = false in grails portlet for liferay . This i was using to share session values with other portlet . session.getAttribute("orgid", PortletSession.APPLICATION_SCOPE) I was getting this error when build,deployed each time refresh the url. Caused by: java.lang.ClassCastExc...

Grails addTo in for loop

I'm doing a website for reading stories. My goal is to do save the content of the story into several pages to get a list and then paginate it easily; I did the following: In the domain I created two domains, Story: class Story { String title List pages static hasMany=[users:User,pages:Page] static belongsTo = [User] ...

Grails AddTo in for loop

I am facing a problem due to that i'm newbie to grails i'm doing a website for reading stories and my goal now is to do save the content of the story into several pages to get a list and then paginate it easily .. so i did the following. in the domain i created two domains one called story and have this : class Story { String title ...

How to output xml namespace with Grails REST webservices

Its a Grails app and we'd like to be able to add XML namespaces to the xml produced for REST clients. Most of the xml is output using "render foo as XML" with the deep converter. So the output needs to be something like: <foo xmlns:myns='http://mycompany.com/myproduct/ver'&gt; ... </foo> ...

grails pagination tag don't access method

I'm newbie to grails and I've tried to use the grails pagination Tag found here link text and when i tried to use it like he says like the this Controller : def pageslist = { [pages: Page.list(params)] } view < g:paginate next="Forward" prev="Back" maxsteps="5" controller="story" action="pageslist" total="${story.pages.count()...

GrailsApplication src/classes

According to Grails API, we can retrieve all domain classes definition through GrailsApplication as such import org.codehaus.groovy.grails.commons.ApplicationHolder as AH AH.application.domainClasses I have classes defined under src/groovy and would like to do the same. I tried using the follwing code but in vain import org....

Rendering a Template In Grails Always Outputs Layout (And I Don't Want It To!)

I have a GSP with a form for submitting a search that updates a div on the page via an Ajax call: <g:submitToRemote value="Search" update="employeeList" url="[controller: 'employee', action: 'searchAjax']" /> My EmployeeController has the searchAjax action: def searchAjax = { def employees = employeeService.search(params.sea...

Do grails domain classes have to be tied to a database?

I am a complete noob when it comes to grails (and still very noobish when it comes to groovy) so I apologise if this is a dumb question. I am building a simple web app and I want to control portions of the domain in my app based on file system objects (i.e. directory structure and file type) rather than database data. How easy is it to ...

Resolving a Grails project's plugins' paths/dependencies

I haven't really done much on this side of project development so please forgive the ignorance. We use SpringSource Tool Suite (STS) and commit ("promote") our codes to a version controller (Accurev). Thing is, we didn't promote our .classpath and .project after the first time to the repository (due to hardcoded paths inserted by the ID...

Is there a way to run multiple Grails apps on the same web server without running into PermGen errors?

We're developing a few Grails applications, and deploying the WARs on Jetty. When we run each of the applications one at a time, they hover at around 200 - 300 MB of memory, which is perfectly acceptable. But, adding any more applications increases the memory footprint... by a lot. Once we have our three applications running, we usual...

How do you fix 550 must be authenticated sending Mail using Grails?

I'm using Grails Mail plugin and trying to send email and keep getting: Error 500: Executing action [sendInvite] of controller [RegisterController] caused exception: Failed messages: javax.mail.SendFailedException: Invalid Addresses; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550 must be authenticated I'm prope...

Cannot GET domain objects from JMS listener

Hi All, In my application I am trying to send e-mails to our customers when some "event occurs" for eg. like when we receive a payment or a new customer sign in... I am successfully able to capture to those events and I am trying to send the mail and here comes the problem I am using JMS to have all this sending mail functionality in t...