Re: Integrate Apache Shiro with Struts2

2017-07-24 Thread tkofford
I've just uploaded a more advanced example of a struts - shiro application. 

https://github.com/tkofford/shiro-realm
<https://github.com/tkofford/shiro-realm>  

This one is essentially the same as the simple one I created earlier, except
I am using a custom shiro realm and doing authentication & authorization in
the realm instead of relying on the shiro.ini file and the default shiro
behavior. This application can easily be altered to using a database or some
other data store, and is basically how we implement shiro in all our
applications that use shiro.

Please let me know if you have any problems or any questions using the
project.

Todd Kofford
tkoff...@ku.edu



--
View this message in context: 
http://struts.1045723.n5.nabble.com/Integrate-Apache-Shiro-with-Struts2-tp5721355p5721691.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Portlet Issue From Struts version 2.5 to 2.5.5?

2016-12-01 Thread tkofford
Issue reported as
https://issues.apache.org/jira/browse/WW-4722
  



--
View this message in context: 
http://struts.1045723.n5.nabble.com/Portlet-Issue-From-Struts-version-2-5-to-2-5-5-tp5720470p5720475.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Portlet Issue From Struts version 2.5 to 2.5.5?

2016-11-30 Thread tkofford
We've been trying to upgrade from struts 2.5 to struts 2.5.5, and most of our
webapps are portlets. However, with struts 2.5.5 portlets throws the
following exception:

"java.lang.IllegalStateException: Not allowed in a portlet"

Below is the method in the classs
org.apache.struts2.portlet.servlet.PortletServletRequest where this always
happens:

public Cookie[] getCookies() {
if (portletRequest instanceof HttpServletRequest) {
return ((HttpServletRequest) 
portletRequest).getCookies();
}
throw new IllegalStateException("Not allowed in a portlet");
}

Apparently, the "portletRequest" variable is not an instance of
"HttpServletRequest".

That class is invoked by the class
org.apache.struts2.interceptor.I18nInterceptor, which I noticed was changed
from version 2.5 which used the old xwork package version of that class. I
also noticed that cookie handling was added in version 2.5.5.

Finally, below is a partial stack trace. Any help would be greatly
appreciated!

Thanks in advance!

Todd Kofford
University of Kansas - IT
tkoff...@ku.edu

SEVERE: Servlet.service() for servlet struts2portlet threw exception
java.lang.IllegalStateException: Not allowed in a portlet
at
org.apache.struts2.portlet.servlet.PortletServletRequest.getCookies(PortletServletRequest.java:101)
at
org.apache.struts2.interceptor.I18nInterceptor.readStoredLocale(I18nInterceptor.java:215)
at
org.apache.struts2.interceptor.I18nInterceptor.storeLocale(I18nInterceptor.java:189)
at
org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:144)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
at
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
at
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:195)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
at
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
at
org.apache.struts2.portlet.interceptor.PortletAwareInterceptor.intercept(PortletAwareInterceptor.java:81)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
at
org.apache.struts2.portlet.interceptor.PortletStateInterceptor.intercept(PortletStateInterceptor.java:51)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
at
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:54)
at
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:481)
at
org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:341)
at
org.jasig.portal.portlet.container.FilterChainImpl.doFilter(FilterChainImpl.java:183)
at
org.jasig.portal.portlet.container.FilterChainImpl.processFilter(FilterChainImpl.java:99)
at
org.jasig.portal.portlet.container.FilterManagerImpl.processFilter(FilterManagerImpl.java:110)
at
org.apache.pluto.container.driver.PortletServlet.dispatch(PortletServlet.java:340)
at
org.apache.pluto.container.driver.PortletServlet.doGet(PortletServlet.java:261)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)




--
View this message in context: 
http://struts.1045723.n5.nabble.com/Portlet-Issue-From-Struts-version-2-5-to-2-5-5-tp5720470.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Portlets

2014-09-02 Thread tkofford
No, I don't remember running into either of those 2 issues, and we have a lot
of struts2 portlets running. However, we mainly only use the view portlet
mode and don't do much with the edit and help portlet modes. The
namespace issue is one that I haven't seen, and we do namespace our
portlets.

Since we develop and run so many portlets, we usually uncover any issues
with upgrades quickly and get right on to submitting fixes for them.

--TK



--
View this message in context: 
http://struts.1045723.n5.nabble.com/Portlets-tp5716587p5716607.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Portlets

2014-08-28 Thread tkofford
I don't know if this will resolve your problem, but you might want to see
this
post:http://struts.1045723.n5.nabble.com/Struts2-Portlets-tp5716471p5716475.html



--
View this message in context: 
http://struts.1045723.n5.nabble.com/Portlets-tp5716587p5716588.html
Sent from the Struts - User mailing list archive at Nabble.com.

Re: Struts2 Portlets

2014-08-04 Thread tkofford
Hi Chris,

Almost all of our struts 2 development is to develop portlets, we use the
struts 2 portlet plugin a lot, and it works well for us. We even have a
couple of web applications where we use the same deployed *.war file for a
standalone webapp and a portlet webapp simultaneously.

We deploy our portlets to a pluto portlet container, so we simply add the
following in our pom.xml to have maven include the pluto-specific entries in
the web.xml that included in the resulting *.war file. It's the same build
process for portlet only and portlet + standalone webapp configurations.

From the pom.xml ...


plugin
artifactIdmaven-war-plugin/artifactId
configuration
   
webXml${project.build.directory}/pluto-resources/web.xml/webXml
/configuration
/plugin


plugin
groupIdorg.apache.portals.pluto/groupId
artifactIdmaven-pluto-plugin/artifactId
version${pluto.version}/version
executions
execution
phasegenerate-resources/phase
goals
goalassemble/goal
/goals
/execution
/executions
/plugin

I hope that helps.

Todd Kofford
tkoff...@ku.edu




--
View this message in context: 
http://struts.1045723.n5.nabble.com/Struts2-Portlets-tp5716471p5716475.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Best Advanced Struts2 Book

2013-06-21 Thread tkofford
I've always liked
Struts 2 in Action http://www.manning.com/dbrown/  
(http://www.manning.com/dbrown/)

-TK



--
View this message in context: 
http://struts.1045723.n5.nabble.com/Best-Advanced-Struts2-Book-tp5712837p5712843.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



JSON Date Format

2011-05-11 Thread tkofford
I am using the struts2 (v 2.2.3) json-plugin and have a model object field
that is a java.util.Date. However, when this date field is converted to json
data it's coming back like 2011-05-11T09:14:41. Some older browsers (IE7 
IE8) don't like this format, but can handle the milliseconds date format
properly.

Is there any way to specify the format of the date field in my model o9bject
when it is converted to json. NOTE - I'd rather not use annotations, because
my model classes are generated from an XML Schema and I' prefer to not alter
them once generated.

Thanks in advance,
tkoff...@ku.edu

--
View this message in context: 
http://struts.1045723.n5.nabble.com/JSON-Date-Format-tp4388152p4388152.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org