is this possible to load dynamically struts action class without having to restart? I am not using any enterprise application container.
See: http://struts.apache.org/2.2.1/docs/spring-plugin.html
Search the page for "Class Reloading"
Related
In my custom Grails plugin, how can I set up a JSON view for a non-domain class and get client apps to use it by default?
I have a view file in the plugin:
/views/com/mycompany/myplugin/myclass/_myClass.gson
When I do grails install, I can see that this .gson file is in the generated JAR. However, the client app is not using it.
What can I do to make it work?
Are there any settings or steps that can make troubleshooting easier?
I am using Grails 3.2.4.
Update:
When I copy the view into a client app, using the exact same path, the view is getting invoked. It's only when the view is defined in the plugin that the view cannot be found.
The framework seems to be trying to look up the plugin as a class from the classloader:
myclientproject_com_mycompany_myplugin_myclass__myClass_gson
How do I get my plugin to add this class to the classpath?
For my use case, what I actually needed was a custom converter.
See:
In JSON views, how do I flatten an object out as a single string?
This obviated the need for my plugin to publish a view.
I would deploy my Vaadin custom themes in Websphere and reference them in some vaadin portlets deployed in Websphere Portal.
I'm using Websphere 8.5 and Vaadin 7. I found a lot of topic about the Tomcat and Liferay combination but nothing usefull for Websphere.
I also tried to set the vaadin.resources.path variable in the 'WP PortletContainerService' in Resources>Resource Environment>Resource Environment Providers and I set a resource with name 'std.portalcontext.vaadin.resources.path' but I can't see it in UI.
Thank you.
Setting that property on the portletcontainerservice is not going to help you because it is not one of the properties that the WebSphere Portal container is going to recognize as a property. I think you may have to do something like this https://vaadin.com/forum/#!/thread/2732876/2732875 specifically these https://vaadin.com/wiki?p_p_id=36&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=row-1&p_p_col_pos=1&p_p_col_count=3&_36_struts_action=%2Fwiki%2Fview&p_r_p_185834411_nodeName=vaadin.com+wiki&p_r_p_185834411_title=Developing+portlets+for+the+Websphere+Portal+Server
The main thing to do is this
In the portlet tag you have to set a value for the portlet-class. For this simple we can use the default Vaadin portlet class com.vaadin.server.VaadinPortlet; you also have to name you UI class as a portlet init parameter.
To let WPS find the Vaadin javascript and theme resources you have to use the portlet init parameter vaadin.resources.path. The value PORTLET_CONTEXT is a Vaadin constant value that makes the vaadin resources available in the portlets resource path.
Run the Maven build with clean package as goals and deploy the created war file in the portal administration. Create a blank portal page and add your portlet to the page. Your "Click me" portlet should look like this:
I need to redirect with some parameter from JSR286(IBM) portlet to JSF 2.0 portlet.
I am having the page unique id and friendly url too.
I have tried response.sendRedirect() and requestDispatcher.forward() but no success till now.
Please provide me some solution.
For navigating between portlets you should not simply forward or redirect pages, since this is not the way to go. The proper way to communicate between portlets, even on different pages is to use interportlet-communication (IPC), commonly known as portlet wiring.
But it all depends on what you mean with a "JSR286(IBM) portlet". A portlet is either a JSR-286 portlet following the global specs (which are the same for all vendors, IBM, Apache, Oracle, Liferay, ...) or you have a portlet using the IBM API/iWidgets, in the last case, portlet wiring is not possible if I remember correctly from the docs.
Anyways, JSF or not, a JSF 2.0 portlet remains a JSR-286 portlet, so you can use normal events in this case as well, though I'm not experienced in JSF. Both portlets should have a portlet descriptor, in which you can declare:
The event, using <event-definition>. Please note that when your JSF-portlet is in a separate portlet application (in a different portlet.xml file), you will have to use an XName, not a normal name.
The events a specific portlet can publish, using <supported-publishing-event> (your JSR-286 portlet)
The events a specific portlet can subscribe to, using <supported-processing-event> (your JSF 2.0 portlet)
Afterwards, you can send an event in your JSR-286 portlet from within the ACTION phase, by using the ActionResponse.setEvent() method.
From the JSF 2.0 portlet, you should still be able to get the PortletRequest/PortletResponse from the context. If you check if it is an instance of EventRequest, you can retrieve the parameter using EventRequest.getEvent(), allowing you to pass parameters between portlets.
If your portlets are on separate pages, you'll have to got the Administration of WebSphere Portal (I assume you're running that since you're talking about IBM), and define global targets for the pages so that events can be triggered cross-page (otherwise wiring is only available for portlets within the same page).
How to make a default custom template in GGTS (Groovy and Grails Tool Suite) for every time I create a new project?? i.e, every time I create a new project I get my custom made template rather the default Grails template.
Thanks in advance
I have a plugin that's shared between multiple applications and I need to set some application specific options that will be used in a service in the plugin. It's an in house written plugin, however, the plugin has to be unaware of which application it's running in.
The best way I can think of doing this is to have some code run in the application right after the service is created in the plugin and call a method on the service to set the options. Is this possible?
If it's not possible, what other design could I implement to pass options to the plugin from the application.
Btw, these options need to be set when the application starts as well as throughout the running of the application.
It's best to use Bootstrap.groovy to to call a method(s) on a Grails service when an application starts. This service can be provided by the application or plugins in the application. Here is a quick example of how to do so:
Bootstrap.groovy
class BootStrap {
def myExampleService
def init = { servletContext ->
myExampleService.someMethodOnTheService()
}
}