cancel
Showing results for 
Search instead for 
Did you mean: 

getParameter via short link jsp

tristan7859
Champ in-the-making
Champ in-the-making
Hi,

I migrated from an alfresco 3.2r2 to alfresco 3.3 a project which have been initially coded by developers who left the company where I just arrived and I have a problem with short links to a jsp, actually I can't retrieve a parameter which was sent via a post to another jsp.

To illustrate the problem please read the example jsp I created let's call it toto (sorry for the french you will find):

toto.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
   
    <%@ page import="org.springframework.extensions.surf.*" %>
    <%@ page import="org.alfresco.web.site.*" %>
    <%@ page import="java.util.Properties" %>

<%
   String          action = request.getParameter("action");
   System.out.println("action: "+action);
   String userid = (String)session.getAttribute(SlingshotUserFactory.SESSION_ATTRIBUTE_KEY_USER_ID);
    RequestContext context = (RequestContext)request.getAttribute(RequestContext.ATTR_REQUEST_CONTEXT);
   System.out.println("context: "+context+" userid: "+userid);
   String nom = "";
   String prenom = "";
   
   System.out.println("nom1: "+nom+"\nprenom1: "+prenom);
   
   nom = request.getParameter("nom");
   prenom = request.getParameter("prenom");
   
   System.out.println("nom: "+nom+"\nprenom: "+prenom);
%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>test du get parameter</title>
</head>
<body>
   <table width="100%" cellspacing="0" style="border: 2px solid #FFFFFF;">
      <tr class="header"><th colspan="2"><div class="titre">test du get parameter</div></th></tr>
   </table>

   <br/>

   <form method="POST" action="toto">
   <table cellspacing="0" align="center" width="70%">
      <tr class="entete"><td colspan="5">ton nom et ton prenom?</td></tr>
      <tr class="rubrique"><td>Nom : </td><td><input type="text" value="<%= nom %>" name="nom" size="40"></td>
      <tr class="rubrique"><td>prenom : </td><td><input type="text" value="<%= prenom %>" name="prenom" size="40"></td>
      <tr class="rubrique"><td colspan="5" align="center"><div class="boutons"><input type="submit" value="Enregistrer"></div></td></tr>
   </table>
   </form>
</body>
</html>

toto.xml in site-data/pages:
<?xml version='1.0' encoding='UTF-8'?>
<page>
   <title>Accueil</title>
   <title-id>page.favorites.title</title-id>
   <description>page d'accueil de l'appliation trombino</description>
   <description-id>page.directory.description</description-id>
   <template-instance>toto</template-instance>
   <authentication>user</authentication> <!– none si la page n'a pas besoin d'authentification –>
</page>

toto.xml in site-data/template-instances
<?xml version='1.0' encoding='UTF-8'?>
<template-instance>
   <template-type>toto</template-type>
</template-instance>

toto.xml in site-data/template-types
<?xml version="1.0" encoding="UTF-8"?>
<template-type>
   <title>essai landing page template type</title>
   <description>essai1 landing page JSP Template Type</description>

   <!– Define the rendering processors for this template type –>   
   <processor mode="view">
      <id>jsp</id>
      <jsp-path>/intranet/toto.jsp</jsp-path>
   </processor>

</template-type>

I think that it's just a problem due to configuration I may have not done. I just don't know what is missing as I just arrived on a already finished alfresco project and I heve never used alfresco before.

Thanks in advance for any help,

Tristan

PS: Sorry for english faults, not yet fluent
5 REPLIES 5

tristan7859
Champ in-the-making
Champ in-the-making
It gives me that btw (and no errors):

action: null
context: RequestContext-29 userid: tesquibet
nom1:
prenom1:
nom: null
prenom: null

tristan7859
Champ in-the-making
Champ in-the-making
I was only doing those tests on IE as most of the people in the company work on IE but weird fact it works on firefox

Any clue?

tristan7859
Champ in-the-making
Champ in-the-making
I think I tested everything, I really don't see who to fix that

Little thing but very important I forgot to tell you if I put the straight path to the jsp (share/intranet/toto.jsp) I get those parameters (but obviously I loose the context, thing I need to avoid in the real jsp I'm working on)

Thanks for any clue

tristan7859
Champ in-the-making
Champ in-the-making
I identified a little more the problem

Under IE8 + Windows xp (my computer) it doesn't work and it's asking a login when the "post" is sent
Under Firefox + Windows xp (still my computer) it works and it's asking a login when the "post" is sent

Under IE8 + Windows 7 (a partner) it works and it's asking a login when the "post" is sent
Under Chrome + Windows 7 (still a partner) it works and it's not asking for a login when the "post" is sent

Knowing that IE8 et chrome are running under integrated authentification and Firefox no

The thing I'd like to reach is integrated authentification under alfresco 3.3 with all browsers and no login asked when the post is sent

Any ideas?

tristan7859
Champ in-the-making
Champ in-the-making
I'm still stuck on that, you don't have any idea?