oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1732945 - in /oltu/trunk/demos/client-demo/src/main: java/org/apache/oltu/oauth2/client/demo/ java/org/apache/oltu/oauth2/client/demo/controller/ webapp/WEB-INF/views/
Date Mon, 29 Feb 2016 20:58:34 GMT
Author: jasha
Date: Mon Feb 29 20:58:34 2016
New Revision: 1732945

URL: http://svn.apache.org/viewvc?rev=1732945&view=rev
Log:
OLTU-50 Improve the client demo in order to work with context root different than '/'
Thanks Marko Asplund for the patch

Modified:
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RegistrationController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
Mon Feb 29 20:58:34 2016
@@ -21,39 +21,46 @@
 
 package org.apache.oltu.oauth2.client.demo;
 
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-
 import org.apache.oltu.oauth2.client.demo.exception.ApplicationException;
 import org.apache.oltu.oauth2.client.demo.model.OAuthParams;
 import org.apache.oltu.oauth2.client.demo.model.OAuthRegParams;
 import org.apache.oltu.oauth2.common.OAuthProviderType;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
-/**
- *
- *
- *
- */
+import javax.servlet.ServletContext;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+
+@Component
 public final class Utils {
-    private Utils() {
+
+    public Utils() {
+    }
+
+    private String redirectUri;
+
+    @Autowired
+    private void setServletContext(ServletContext ctx) {
+        String contextPath = ctx.getContextPath();
+        redirectUri = "http://localhost:8080" + contextPath + "/redirect";
     }
 
-    public static final String REDIRECT_URI = "http://localhost:8080/redirect";
     public static final String DISCOVERY_URI = "http://localhost:8080";
 
     public static final String REG_TYPE_PULL = "pull";
     public static final String REG_TYPE_PUSH = "push";
-    
-    public static final String REQUEST_TYPE_QUERY= "queryParameter";
-    public static final String REQUEST_TYPE_HEADER= "headerField";
-    public static final String REQUEST_TYPE_BODY= "bodyParameter";
 
-    public static final String GENERIC = "generic"; 
-    
+    public static final String REQUEST_TYPE_QUERY = "queryParameter";
+    public static final String REQUEST_TYPE_HEADER = "headerField";
+    public static final String REQUEST_TYPE_BODY = "bodyParameter";
+
+    public static final String GENERIC = "generic";
+
     public static final String FACEBOOK = OAuthProviderType.FACEBOOK.getProviderName();
     public static final String FACEBOOK_AUTHZ = OAuthProviderType.FACEBOOK.getAuthzEndpoint();
     public static final String FACEBOOK_TOKEN = OAuthProviderType.FACEBOOK.getTokenEndpoint();
-    
+
     public static final String GOOGLE = OAuthProviderType.GOOGLE.getProviderName();
     public static final String GOOGLE_AUTHZ = OAuthProviderType.GOOGLE.getAuthzEndpoint();
     public static final String GOOGLE_TOKEN = OAuthProviderType.GOOGLE.getTokenEndpoint();
@@ -71,7 +78,11 @@ public final class Utils {
     public static final String SMART_GALLERY_TOKEN = "http://localhost:8090/oauth/token";
     public static final String SMART_GALLERY_REGISTER = "http://localhost:8090/oauthreg/register";
 
-    public static void validateRegistrationParams(OAuthRegParams oauthParams) throws ApplicationException
{
+    public String getRedirectUri() {
+        return redirectUri;
+    }
+
+    public void validateRegistrationParams(OAuthRegParams oauthParams) throws ApplicationException
{
 
         String regType = oauthParams.getRegistrationType();
 
@@ -104,9 +115,7 @@ public final class Utils {
 
     }
 
-    public static void validateAuthorizationParams(OAuthParams oauthParams) throws ApplicationException
{
-
-
+    public void validateAuthorizationParams(OAuthParams oauthParams) throws ApplicationException
{
         String authzEndpoint = oauthParams.getAuthzEndpoint();
         String tokenEndpoint = oauthParams.getTokenEndpoint();
         String clientId = oauthParams.getClientId();
@@ -131,7 +140,7 @@ public final class Utils {
             sb.append("Client Secret ");
         }
 
-        if (!REDIRECT_URI.equals(redirectUri)) {
+        if (!getRedirectUri().equals(redirectUri)) {
             sb.append("Redirect URI");
         }
 
@@ -143,7 +152,7 @@ public final class Utils {
 
     }
 
-    public static void validateTokenParams(OAuthParams oauthParams) throws ApplicationException
{
+    public void validateTokenParams(OAuthParams oauthParams) throws ApplicationException
{
 
         String authzEndpoint = oauthParams.getAuthzEndpoint();
         String tokenEndpoint = oauthParams.getTokenEndpoint();
@@ -174,7 +183,7 @@ public final class Utils {
             sb.append("Client Secret ");
         }
 
-        if (!REDIRECT_URI.equals(redirectUri)) {
+        if (!getRedirectUri().equals(redirectUri)) {
             sb.append("Redirect URI");
         }
 

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
Mon Feb 29 20:58:34 2016
@@ -28,6 +28,7 @@ import org.apache.oltu.oauth2.common.exc
 import org.apache.oltu.oauth2.common.message.types.ResponseType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -47,6 +48,9 @@ public class AuthzController {
 
     private Logger logger = LoggerFactory.getLogger(AuthzController.class);
 
+    @Autowired
+    private Utils utils;
+
     @RequestMapping("/authorize")
     public ModelAndView authorize(@ModelAttribute("oauthParams") OAuthParams oauthParams,
                                   HttpServletRequest req,
@@ -56,7 +60,7 @@ public class AuthzController {
         logger.debug("start processing /authorize request");
 
         try {
-            Utils.validateAuthorizationParams(oauthParams);
+            utils.validateAuthorizationParams(oauthParams);
 
             res.addCookie(new Cookie("clientId", oauthParams.getClientId()));
             res.addCookie(new Cookie("clientSecret", oauthParams.getClientSecret()));

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
Mon Feb 29 20:58:34 2016
@@ -30,6 +30,7 @@ import org.apache.oltu.oauth2.jwt.io.JWT
 import org.apache.oltu.oauth2.jwt.io.JWTReader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -48,6 +49,9 @@ public class MainController {
 
     private final JWTReader jwtReader = new JWTReader();
 
+    @Autowired
+    private Utils utils;
+
     @RequestMapping("/index")
     public ModelAndView authorize(@ModelAttribute("oauthParams") OAuthParams oauthParams)
         throws OAuthSystemException, IOException {
@@ -86,12 +90,12 @@ public class MainController {
             oauthRegParams.setTokenEndpoint(Utils.SMART_GALLERY_TOKEN);
             oauthRegParams.setRegistrationEndpoint(Utils.SMART_GALLERY_REGISTER);
             oauthRegParams.setApplication(app);
-            oauthRegParams.setRedirectUri(Utils.REDIRECT_URI);
+            oauthRegParams.setRedirectUri(utils.getRedirectUri());
             return new ModelAndView("register");
         }
         if (selected) {
             oauthParams.setApplication(app);
-            oauthParams.setRedirectUri(Utils.REDIRECT_URI);
+            oauthParams.setRedirectUri(utils.getRedirectUri());
             return new ModelAndView("get_authz");
         }
 

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RegistrationController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RegistrationController.java?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RegistrationController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RegistrationController.java
Mon Feb 29 20:58:34 2016
@@ -35,6 +35,7 @@ import org.apache.oltu.oauth2.ext.dynami
 import org.apache.oltu.oauth2.ext.dynamicreg.common.OAuthRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -48,6 +49,9 @@ public class RegistrationController {
 
     private Logger logger = LoggerFactory.getLogger(RegistrationController.class);
 
+    @Autowired
+    private Utils utils;
+
     @RequestMapping(value = "/register")
     public ModelAndView authorize(@ModelAttribute("oauthRegParams") OAuthRegParams oauthRegParams,
                                   @ModelAttribute("oauthParams") OAuthParams oauthParams,
@@ -56,25 +60,9 @@ public class RegistrationController {
         logger.debug("start processing /register request");
 
         try {
-            Utils.validateRegistrationParams(oauthRegParams);
-
-            OAuthClientRequest request = null;
-            if (Utils.REG_TYPE_PULL.equals(oauthRegParams.getRegistrationType())) {
-                request = OAuthClientRegistrationRequest
-                    .location(oauthRegParams.getRegistrationEndpoint(), OAuthRegistration.Type.PULL)
-                    .setUrl(oauthRegParams.getUrl())
-                    .buildBodyMessage();
-            } else {
-                request = OAuthClientRegistrationRequest
-                    .location(oauthRegParams.getRegistrationEndpoint(), OAuthRegistration.Type.PUSH)
-                    .setName(oauthRegParams.getName())
-                    .setUrl(oauthRegParams.getUrl())
-                    .setDescription(oauthRegParams.getDescription())
-                    .setRedirectURL(oauthRegParams.getRedirectUri())
-                    .setIcon(oauthRegParams.getIcon())
-                    .buildBodyMessage();
-            }
+            utils.validateRegistrationParams(oauthRegParams);
 
+            OAuthClientRequest request = getoAuthClientRequest(oauthRegParams);
 
             OAuthRegistrationClient client = new OAuthRegistrationClient(new URLConnectionClient());
             OAuthClientRegistrationResponse response = client.clientInfo(request);
@@ -99,4 +87,24 @@ public class RegistrationController {
         }
     }
 
+    private OAuthClientRequest getoAuthClientRequest(OAuthRegParams oauthRegParams) throws
OAuthSystemException {
+        OAuthClientRequest request;
+        if (Utils.REG_TYPE_PULL.equals(oauthRegParams.getRegistrationType())) {
+            request = OAuthClientRegistrationRequest
+                .location(oauthRegParams.getRegistrationEndpoint(), OAuthRegistration.Type.PULL)
+                .setUrl(oauthRegParams.getUrl())
+                .buildBodyMessage();
+        } else {
+            request = OAuthClientRegistrationRequest
+                .location(oauthRegParams.getRegistrationEndpoint(), OAuthRegistration.Type.PUSH)
+                .setName(oauthRegParams.getName())
+                .setUrl(oauthRegParams.getUrl())
+                .setDescription(oauthRegParams.getDescription())
+                .setRedirectURL(oauthRegParams.getRedirectUri())
+                .setIcon(oauthRegParams.getIcon())
+                .buildBodyMessage();
+        }
+        return request;
+    }
+
 }

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
Mon Feb 29 20:58:34 2016
@@ -39,6 +39,7 @@ import org.apache.oltu.oauth2.jwt.io.JWT
 import org.apache.oltu.openidconnect.client.response.OpenIdConnectResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -52,13 +53,16 @@ import java.net.URI;
 public class TokenController {
     private Logger logger = LoggerFactory.getLogger(TokenController.class);
 
+    @Autowired
+    private Utils utils;
+
     @RequestMapping("/get_token")
     public ModelAndView authorize(@ModelAttribute("oauthParams") OAuthParams oauthParams,
                                   HttpServletRequest req) throws OAuthSystemException, IOException
{
         logger.debug("authorizing");
 
         try {
-            Utils.validateTokenParams(oauthParams);
+            utils.validateTokenParams(oauthParams);
 
             OAuthClientRequest request = OAuthClientRequest
                 .tokenLocation(oauthParams.getTokenEndpoint())

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp Mon Feb 29 20:58:34
2016
@@ -29,14 +29,14 @@
 <html>
   <head>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    <link href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet" media="screen">
     <title>Apache Oltu - OAuth V2.0 Client Application</title>
   </head>
 
   <body>
     <div class="jumbotron">
       <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="/images/logo_oltu.png"
/>
+        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
         <h1>Apache Oltu</h1>
         <p>Sample OAuth V2.0 Client Application</p>
       </div>
@@ -52,7 +52,8 @@
         <div class="alert alert-danger">Error: ${oauthParams.errorMessage}</div>
       </c:if>
 
-      <form:form class="form-horizontal" role="form" commandName="oauthParams" action="/authorize">
+      <c:url var="actionUrl" value="/authorize"/>
+      <form:form class="form-horizontal" role="form" commandName="oauthParams" action="${actionUrl}">
         <div class="form-group">
           <label for="scope" class="col-lg-3 control-label">Requested Access Scope</label>
           <div class="col-lg-9"><form:input class="form-control" id="scope" path="scope"
/></div>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp Mon Feb 29
20:58:34 2016
@@ -29,14 +29,14 @@
 <html>
   <head>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    <link href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet" media="screen">
     <title>Apache Oltu - OAuth V2.0 Client Application</title>
   </head>
 
   <body>
     <div class="jumbotron">
       <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="/images/logo_oltu.png"
/>
+        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
         <h1>Apache Oltu</h1>
         <p>Sample OAuth V2.0 Client Application</p>
       </div>
@@ -52,7 +52,9 @@
         <div class="alert alert-danger">${oauthParams.errorMessage}</div>
       </c:if>
 
-      <form:form class="form-horizontal" role="form" commandName="oauthParams" action="/get_resource">
+      <c:url var="actionUrl" value="/get_resource"/>
+
+      <form:form class="form-horizontal" role="form" commandName="oauthParams" action="${actionUrl}">
         <div class="form-group">
           <label for="resourceUrl" class="col-lg-3 control-label">Resource URL</label>
           <div class="col-lg-9"><form:input class="form-control" id="resourceUrl"
path="resourceUrl" /></div>
@@ -121,7 +123,7 @@
         <input type="submit" class="btn btn-primary pull-right" value="Get Resource" />
       </form:form>
 
-      <form:form commandName="oauthParams" action="/get_resource">
+      <form:form commandName="oauthParams" action="${actionUrl}">
         <h4>OpenId Connect</h4>
 
         <c:if test="${oauthParams.idTokenValid}">
@@ -158,7 +160,7 @@
             <div class="panel-heading">
               <h3 class="panel-title">Claims Set</h3>
             </div>
-            <div class="panel-body">${oauthParams.claimsSet}</div>
+            <pre class="panel-body"><c:out value="${oauthParams.claimsSet}"/></pre>
           </div>
         </c:if>
       </form:form>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp Mon Feb 29 20:58:34
2016
@@ -29,14 +29,14 @@
 <html>
   <head>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    <link href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet" media="screen">
     <title>Apache Oltu - OAuth V2.0 Client Application</title>
   </head>
 
   <body>
     <div class="jumbotron">
       <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="/images/logo_oltu.png"
/>
+        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
         <h1>Apache Oltu</h1>
         <p>Sample OAuth V2.0 Client Application</p>
       </div>
@@ -48,12 +48,12 @@
       <nav class="navbar navbar-default" role="navigation">
         <div class="collapse navbar-collapse navbar-ex1-collapse">
           <ul class="nav navbar-nav">
-            <li><a href="/main/generic">Generic OAuth2 Application</a></li>
-            <li><a href="/main/smart_gallery">Smart Gallery</a></li>
-            <li><a href="/main/facebook">Facebook</a></li>
-            <li><a href="/main/google">Google</a></li>
-            <li><a href="/main/github">Github</a></li>
-            <li><a href="/main/linkedin">LinkedIn</a></li>
+            <li><a href="<c:url value="/main/generic"/>">Generic OAuth2
Application</a></li>
+            <li><a href="<c:url value="/main/smart_gallery"/>">Smart Gallery</a></li>
+            <li><a href="<c:url value="/main/facebook"/>">Facebook</a></li>
+            <li><a href="<c:url value="/main/google"/>">Google</a></li>
+            <li><a href="<c:url value="/main/github"/>">Github</a></li>
+            <li><a href="<c:url value="/main/linkedin"/>">LinkedIn</a></li>
           </ul>
         </div>
       </nav>
@@ -64,7 +64,8 @@
         <div class="alert alert-danger">${oauthParams.errorMessage}</div>
       </c:if>
 
-      <form:form role="form" commandName="oauthParams" action="/decode">
+      <c:url var="actionUrl" value="/decode"/>
+      <form:form role="form" commandName="oauthParams" action="${actionUrl}">
         <form:textarea path="jwt" id="jwt" rows="15" class="form-control" />
         <form:hidden path="application" />
         <div class="clearfix">&nbsp;<br/></div>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp Mon Feb 29 20:58:34
2016
@@ -29,14 +29,14 @@
 <html>
   <head>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    <link href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet" media="screen">
     <title>Apache Oltu - OAuth V2.0 Client Application</title>
   </head>
 
   <body>
     <div class="jumbotron">
       <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="/images/logo_oltu.png"
/>
+        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
         <h1>Apache Oltu</h1>
         <p>Sample OAuth V2.0 Client Application</p>
       </div>
@@ -52,7 +52,8 @@
       <div class="alert alert-danger">${oauthRegParams.errorMessage}</div>
       </c:if>
 
-      <form:form class="form-horizontal" role="form" commandName="oauthRegParams" action="/register">
+      <c:url var="actionUrl" value="/register"/>
+      <form:form class="form-horizontal" role="form" commandName="oauthRegParams" action="${actionUrl}">
         <div class="form-group">
           <label for="registrationType" class="col-lg-3 control-label">Registration
Type</label>
           <div class="col-lg-9">

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp Mon Feb 29
20:58:34 2016
@@ -29,14 +29,14 @@
 <html>
   <head>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    <link href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet" media="screen">
     <title>Apache Oltu - OAuth V2.0 Client Application</title>
   </head>
 
   <body>
     <div class="jumbotron">
       <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="/images/logo_oltu.png"
/>
+        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
         <h1>Apache Oltu</h1>
         <p>Sample OAuth V2.0 Client Application</p>
       </div>
@@ -52,7 +52,8 @@
         <div class="alert alert-danger">${oauthParams.errorMessage}</div>
       </c:if>
 
-      <form:form commandName="oauthParams" action="/get_token">
+      <c:url var="actionUrl" value="/get_token"/>
+      <form:form commandName="oauthParams" action="${actionUrl}">
         <div class="form-group">
           <label for="authzCode" class="col-lg-3 control-label">Authorization Code</label>
           <div class="col-lg-9"><form:input class="form-control" id="authzCode"
path="authzCode" /></div>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp?rev=1732945&r1=1732944&r2=1732945&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp Mon Feb 29 20:58:34
2016
@@ -29,14 +29,14 @@
 <html>
   <head>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    <link href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet" media="screen">
     <title>Apache Oltu - OAuth V2.0 Client Application</title>
   </head>
 
   <body>
     <div class="jumbotron">
       <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="/images/logo_oltu.png"
/>
+        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
         <h1>Apache Oltu</h1>
         <p>Sample OAuth V2.0 Client Application</p>
       </div>
@@ -53,7 +53,7 @@
       </c:if>
 
       <div class="panel panel-default">
-        <div class="panel-body">${oauthParams.resource}</div>
+        <pre class="panel-body"><c:out value="${oauthParams.resource}"/></pre>
       </div>
     </div>
   </body>



Mime
View raw message