You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by ka...@apache.org on 2010/04/02 01:17:53 UTC
svn commit: r930132 - in
/incubator/shiro/trunk/samples/spring-client/src/main:
java/org/apache/shiro/samples/spring/ui/WebStartDriver.java
jnlp/template.vm resources/webstart.spring.xml
Author: kaosko
Date: Thu Apr 1 23:17:53 2010
New Revision: 930132
URL: http://svn.apache.org/viewvc?rev=930132&view=rev
Log:
IN PROGRESS - issue SHIRO-89: Sample Spring Application - WebStart won't launch
http://issues.apache.org/jira/browse/SHIRO-89
- pass the sessionId as the webstart app argument and set it to static property of WebStartDriver
Modified:
incubator/shiro/trunk/samples/spring-client/src/main/java/org/apache/shiro/samples/spring/ui/WebStartDriver.java
incubator/shiro/trunk/samples/spring-client/src/main/jnlp/template.vm
incubator/shiro/trunk/samples/spring-client/src/main/resources/webstart.spring.xml
Modified: incubator/shiro/trunk/samples/spring-client/src/main/java/org/apache/shiro/samples/spring/ui/WebStartDriver.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/samples/spring-client/src/main/java/org/apache/shiro/samples/spring/ui/WebStartDriver.java?rev=930132&r1=930131&r2=930132&view=diff
==============================================================================
--- incubator/shiro/trunk/samples/spring-client/src/main/java/org/apache/shiro/samples/spring/ui/WebStartDriver.java (original)
+++ incubator/shiro/trunk/samples/spring-client/src/main/java/org/apache/shiro/samples/spring/ui/WebStartDriver.java Thu Apr 1 23:17:53 2010
@@ -29,8 +29,11 @@ import org.springframework.context.suppo
* @since 0.1
*/
public class WebStartDriver {
+ public static String LAUNCH_SESSION_ID;
public static void main(String[] args) {
+ // Store the session id given as argument to a static property to make it available for Spring context
+ if (args.length > 0) LAUNCH_SESSION_ID = args[0];
new ClassPathXmlApplicationContext("webstart.spring.xml");
}
}
Modified: incubator/shiro/trunk/samples/spring-client/src/main/jnlp/template.vm
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/samples/spring-client/src/main/jnlp/template.vm?rev=930132&r1=930131&r2=930132&view=diff
==============================================================================
--- incubator/shiro/trunk/samples/spring-client/src/main/jnlp/template.vm (original)
+++ incubator/shiro/trunk/samples/spring-client/src/main/jnlp/template.vm Thu Apr 1 23:17:53 2010
@@ -41,8 +41,13 @@
<resources>
<j2se version="$j2seVersion"/>
- $dependencies
- <property name="shiro.session.id" value="${sessionId}"/>
+ $dependencies
+ <%-- reading custom system properties requires more permissions than available in sandbox mode,
+ thus we need to sign the jars (although we are using an argument instead of a property to set this)
+ <property name="shiro.session.id" value="${sessionId}"/>
+ --%>
</resources>
- <application-desc main-class="$mainClass"/>
+ <application-desc main-class="$mainClass">
+ <argument>${sessionId}</argument>
+ </application-desc>
</jnlp>
\ No newline at end of file
Modified: incubator/shiro/trunk/samples/spring-client/src/main/resources/webstart.spring.xml
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/samples/spring-client/src/main/resources/webstart.spring.xml?rev=930132&r1=930131&r2=930132&view=diff
==============================================================================
--- incubator/shiro/trunk/samples/spring-client/src/main/resources/webstart.spring.xml (original)
+++ incubator/shiro/trunk/samples/spring-client/src/main/resources/webstart.spring.xml Thu Apr 1 23:17:53 2010
@@ -17,12 +17,15 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-
<!--
- Application context for Shiro WebStart sample application
-->
-<beans>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<bean id="webStartView"
class="org.apache.shiro.samples.spring.ui.WebStartView">
@@ -37,6 +40,10 @@
</bean>
<bean id="secureRemoteInvocationFactory"
- class="org.apache.shiro.spring.remoting.SecureRemoteInvocationFactory"/>
+ class="org.apache.shiro.spring.remoting.SecureRemoteInvocationFactory">
+ <constructor-arg index="0">
+ <util:constant static-field="org.apache.shiro.samples.spring.ui.WebStartDriver.LAUNCH_SESSION_ID"/>
+ </constructor-arg>
+ </bean>
</beans>