Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-23 Thread Johan Compagner
that seems to be the error then.What is the full stacktrace of that error?johanOn 10/23/06, kurt heston <
[EMAIL PROTECTED]> wrote:Is this normal behavior or a good place to start chasing down my issue:
"java.lang.NoSuchFieldException: username"kurt heston wrote:> Something changed about how I'm supposed to override WebRequestCycle.> This is where my values are disappearing.  Reading up on it now...
>> Igor Vaynberg wrote:>>> yes you are too vague, and another problem is that this list has been>> down because of sf.net  for a while. -Igor>> On 10/2/06, * kurt heston* <[EMAIL PROTECTED]>> 
[EMAIL PROTECTED]>> wrote: Am I being too vague here to get an answer?  Do I need to post my>> code? kurt heston wrote:>> > All I did was switch from 
wicket-1.2-rc3.jar to wicket-1.2.2.jar>> and my>> > SignIn page, adapted from  Juergen's code, stopped working.  The>> fields>> > are always an empty string.
>> >>> > What did I miss in the release notes?>> >>> >>> ->> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance>> to share your>> > opinions on IT & business topics through brief surveys -- and>> earn cash
>> >>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>> <
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>>> > ___
>> > Wicket-user mailing list>> > Wicket-user@lists.sourceforge.net>> 
Wicket-user@lists.sourceforge.net>>> > https://lists.sourceforge.net/lists/listinfo/wicket-user>> >>> >
 - Take Surveys. Earn Cash. Influence the Future of IT>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your>> opinions on IT & business topics through brief surveys -- and earn>> cash>> 
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>> >> ___>> Wicket-user mailing list>> Wicket-user@lists.sourceforge.net
>> Wicket-user@lists.sourceforge.net>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
 -> Using Tomcat but need to do more? Need to support web services, security?> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___> Wicket-user mailing list> Wicket-user@lists.sourceforge.net> 
https://lists.sourceforge.net/lists/listinfo/wicket-user>>-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-22 Thread kurt heston

The attached code works fine with 1.2RC3, does not work with 1.2.2. I'm
pretty sure the problem lies in with MyApplication or RequestCycle just
not sure where.
package test.base;

import java.awt.Color;

import test.auth.UserSession;
import wicket.Resource;
import wicket.markup.html.WebPage;
import wicket.markup.html.form.ImageButton;
import wicket.markup.html.image.resource.DefaultButtonImageResource;
import wicket.markup.html.link.BookmarkablePageLink;
import wicket.markup.html.link.PopupSettings;

public class BasePage extends WebPage {
  
  public static ImageButton getButton(String buttonName, String label) {
DefaultButtonImageResource r = new DefaultButtonImageResource(label);
Color c = new Color(60, 179, 113);
r.setColor(c);
return new ImageButton(buttonName, r);
  }

  public static Resource getButton(String label) {
DefaultButtonImageResource r = new DefaultButtonImageResource(label);
Color c = new Color(60, 179, 113);
r.setColor(c);

return r;
  }

  public UserSession getWebSession() {
return (UserSession) getSession();
  }

  protected BookmarkablePageLink popInstructions(String string, Class class1) {
PopupSettings popupSettings = new PopupSettings().setHeight(500).setWidth(
500);
BookmarkablePageLink pl = new BookmarkablePageLink(string, class1);
pl.setPopupSettings(popupSettings);

return pl;
  }

}package test.data;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateConnectionMgr {

  public static final SessionFactory sessionFactory;

  static {
try {
  // Create the SessionFactory from hibernate.cfg.xml
  sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
  // Make sure you log the exception, as it might be swallowed
  System.err.println("Initial SessionFactory creation failed." + ex);
  throw new ExceptionInInitializerError(ex);
}
  }

  public static final ThreadLocal session = new ThreadLocal();

  public static Session currentSession() throws HibernateException {
Session s = (Session) session.get();

// Open a new Session, if this thread has none yet
if (s == null) {
  s = sessionFactory.openSession();
  // Store it in the ThreadLocal variable
  session.set(s);
}

if (!s.isOpen()) {
  s = sessionFactory.openSession();
  // Store it in the ThreadLocal variable
  session.set(s);
}

return s;
  }

  public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
if (s != null)
  s.close();
session.set(null);
  }
}http://wicket.sourceforge.net/";>






package test;

import org.apache.log4j.Logger;

import test.auth.UserSession;
import test.base.BasePage;


public class Main extends BasePage {

  UserSession ses = getWebSession();

  static Logger logger = Logger.getLogger(Main.class);

  public Main() {
rebuild();
  }

  private void rebuild() {
  }

  public UserSession getUserSession() {
return (UserSession) getSession();

  }

}
package test.base;

import java.io.Serializable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import test.Main;
import test.auth.SignIn;
import test.auth.UserSession;
import wicket.IRequestCycleFactory;
import wicket.ISessionFactory;
import wicket.Request;
import wicket.RequestCycle;
import wicket.Response;
import wicket.Session;
import wicket.authorization.strategies.page.SimplePageAuthorizationStrategy;
import wicket.protocol.http.WebApplication;
import wicket.protocol.http.WebRequest;
import wicket.protocol.http.WebSession;

public final class MyApplication extends WebApplication implements
ISessionFactory, Serializable {

  /** Logger. */
  private static Log log = LogFactory.getLog(MyApplication.class);

  private final SessionFactory sessionFactory;

  public void init() {
SimplePageAuthorizationStrategy authorizationStrategy = new 
SimplePageAuthorizationStrategy(
BasePage.class, SignIn.class) {
  protected boolean isAuthorized() {
return (((UserSession) Session.get()).isSignedIn());
  }
};

getSecuritySettings().setAuthorizationStrategy(authorizationStrategy);
getAjaxSettings().setAjaxDebugModeEnabled(false);
  }

  /**
   * custom request cycle factory.
   */
  private IRequestCycleFactory requestCycleFactory = new IRequestCycleFactory() 
{
public RequestCycle newRequestCycle(Session session, Request request,
Response response) {
  return new test.base.RequestCycle((WebSession) session,
  (WebRequest) request, response, sessionFactory);
}
  };

  /**
   * Constructor
   */
  public MyApplication() {
super();
try {
  final Configuration configuration = new Configuration();
  confi

Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-22 Thread kurt heston
Is this normal behavior or a good place to start chasing down my issue:

"java.lang.NoSuchFieldException: username"

kurt heston wrote:
> Something changed about how I'm supposed to override WebRequestCycle.  
> This is where my values are disappearing.  Reading up on it now...
>
> Igor Vaynberg wrote:
>   
>> yes you are too vague, and another problem is that this list has been 
>> down because of sf.net  for a while.
>>
>> -Igor
>>
>>
>> On 10/2/06, * kurt heston* <[EMAIL PROTECTED] 
>> > wrote:
>>
>> Am I being too vague here to get an answer?  Do I need to post my
>> code?
>>
>> kurt heston wrote:
>> > All I did was switch from wicket-1.2-rc3.jar to wicket-1.2.2.jar
>> and my
>> > SignIn page, adapted from  Juergen's code, stopped working.  The
>> fields
>> > are always an empty string.
>> >
>> > What did I miss in the release notes?
>> >
>> >
>> -
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance
>> to share your
>> > opinions on IT & business topics through brief surveys -- and
>> earn cash
>> >
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> 
>> 
>> > ___
>> > Wicket-user mailing list
>> > Wicket-user@lists.sourceforge.net
>> 
>> > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >
>> >
>>
>> -
>>
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your
>> opinions on IT & business topics through brief surveys -- and earn
>> cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> 
>> 
>> ___
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> 
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>>
>> 
>
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>   

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-22 Thread kurt heston
Something changed about how I'm supposed to override WebRequestCycle.  
This is where my values are disappearing.  Reading up on it now...

Igor Vaynberg wrote:
> yes you are too vague, and another problem is that this list has been 
> down because of sf.net  for a while.
>
> -Igor
>
>
> On 10/2/06, * kurt heston* <[EMAIL PROTECTED] 
> > wrote:
>
> Am I being too vague here to get an answer?  Do I need to post my
> code?
>
> kurt heston wrote:
> > All I did was switch from wicket-1.2-rc3.jar to wicket-1.2.2.jar
> and my
> > SignIn page, adapted from  Juergen's code, stopped working.  The
> fields
> > are always an empty string.
> >
> > What did I miss in the release notes?
> >
> >
> -
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance
> to share your
> > opinions on IT & business topics through brief surveys -- and
> earn cash
> >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> 
> > ___
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> 
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
> -
>
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
> share your
> opinions on IT & business topics through brief surveys -- and earn
> cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> 
> ___
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> 
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-05 Thread Igor Vaynberg
yes you are too vague, and another problem is that this list has been down because of sf.net for a while.-IgorOn 10/2/06, 
kurt heston <[EMAIL PROTECTED]> wrote:
Am I being too vague here to get an answer?  Do I need to post my code?kurt heston wrote:> All I did was switch from wicket-1.2-rc3.jar to wicket-1.2.2.jar and my> SignIn page, adapted from  Juergen's code, stopped working.  The fields
> are always an empty string.>> What did I miss in the release notes?>> -> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your> opinions on IT & business topics through brief surveys -- and earn cash> 
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> ___> Wicket-user mailing list> 
Wicket-user@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/wicket-user>>-
Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-05 Thread Frank Bille
Yes please try to share some code with shows where the problem exatly is.FrankOn 10/2/06, kurt heston <
[EMAIL PROTECTED]> wrote:Am I being too vague here to get an answer?  Do I need to post my code?
kurt heston wrote:> All I did was switch from wicket-1.2-rc3.jar to wicket-1.2.2.jar and my> SignIn page, adapted from  Juergen's code, stopped working.  The fields> are always an empty string.
>> What did I miss in the release notes?>> -> Take Surveys. Earn Cash. Influence the Future of IT> Join SourceForge.net
's Techsay panel and you'll get the chance to share your> opinions on IT & business topics through brief surveys -- and earn cash> 
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> ___> Wicket-user mailing list> 
Wicket-user@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/wicket-user>>-
Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-02 Thread Eelco Hillenius
I tested the examples (singin, signing2), and they work fine. Can you  
double check if you didn't forget anything? If you still think it is  
an issue, please add a bug report to our issue tracker.

Eelco


On Oct 2, 2006, at 7:41 AM, kurt heston wrote:

> All I did was switch from wicket-1.2-rc3.jar to wicket-1.2.2.jar  
> and my
> SignIn page, adapted from  Juergen's code, stopped working.  The  
> fields
> are always an empty string.
>
> What did I miss in the release notes?
>
> -- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys -- and earn  
> cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> ___
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-02 Thread kurt heston
Here's the code...it should look VERY familiar.  It works when I use
wicket-1.2-rc3.jar, but not when I use wicket-1.2.2.jar.

With 1.2.2, getUsername and getPassword always return an empty string.

//-

/*
*
==
* Licensed under the Apache License, Version 2.0 (the "License"); you
may not
* use this file except in compliance with the License. You may obtain a
copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and
limitations under
* the License.
*/
import wicket.Application;
import wicket.markup.html.WebMarkupContainer;
import wicket.markup.html.form.CheckBox;
import wicket.markup.html.form.Form;
import wicket.markup.html.form.PasswordTextField;
import wicket.markup.html.form.TextField;
import wicket.markup.html.panel.FeedbackPanel;
import wicket.markup.html.panel.Panel;
import wicket.model.PropertyModel;
import wicket.util.value.ValueMap;

/**
* Reusable user sign in panel with username and password as well as
support for
* cookie persistence of the both. When the SignInPanel's form is
submitted, the
* abstract method signIn(String, String) is called, passing the
username and
* password submitted. The signIn() method should sign the user in and
return
* null if no error ocurred, or a descriptive String in the event that
the sign
* in fails.
*
* @author Jonathan Locke
* @author Juergen Donnerstag
* @author Eelco Hillenius
*/
public abstract class SignInPanel extends Panel {
  /** True if the panel should display a remember-me checkbox */
  private boolean includeRememberMe = true;

  /** Field for password. */
  private PasswordTextField password;

  /** True if the user should be remembered via form persistence
(cookies) */
  private boolean rememberMe = true;

  /** Field for user name. */
  private TextField username;

  /**
   * Sign in form.
   */
  public final class SignInForm extends Form {
/** El-cheapo model for form. */
private final ValueMap properties = new ValueMap();

/**
 * Constructor.
 *
 * @param id
 *id of the form component
 */
public SignInForm(final String id) {
  super(id);

  // Attach textfield components that edit properties map
  // in lieu of a formal beans model
  add(username = new TextField("username", new PropertyModel(properties,
  "username")));
  add(password = new PasswordTextField("password", new PropertyModel(
  properties, "password")));

  // MarkupContainer row for remember me checkbox
  WebMarkupContainer rememberMeRow = new
WebMarkupContainer("rememberMeRow");
  add(rememberMeRow);

  // Add rememberMe checkbox
  rememberMeRow.add(new CheckBox("rememberMe", new PropertyModel(
  SignInPanel.this, "rememberMe")));

  // Make form values persistent
  setPersistent(rememberMe);

  // Show remember me checkbox?
  rememberMeRow.setVisible(includeRememberMe);
}

/**
 * @see wicket.markup.html.form.Form#onSubmit()
 */
public final void onSubmit() {
  if (signIn(getUsername(), getPassword())) {
// If login has been called because the user was not yet
// logged in, than continue to the original destination,
// otherwise to the Home page
if (getPage().continueToOriginalDestination()) {
  // HTTP redirect response has been committed. No more data
  // shall be written to the response.
  setResponsePage(Application.get().getHomePage());
} else {
  setResponsePage(Application.get().getHomePage());
}
  } else {
// Try the component based localizer first. If not found try the
// application localizer. Else use the default
final String errmsg = getLocalizer().getString("loginError", this,
"Unable to sign you in");

error(errmsg);
  }
}
  }

  /**
   * @see wicket.Component#Component(String)
   */
  public SignInPanel(final String id) {
this(id, true);
  }

  /**
   * @param id
   *See Component constructor
   * @param includeRememberMe
   *True if form should include a remember-me checkbox
   * @see wicket.Component#Component(String)
   */
  public SignInPanel(final String id, final boolean includeRememberMe) {
super(id);

this.includeRememberMe = includeRememberMe;

// Create feedback panel and add to page
final FeedbackPanel feedback = new FeedbackPanel("feedback");
add(feedback);

// Add sign-in form to page, passing feedback panel as
// validation error handler
add(new SignInForm("signInForm"));
 

Re: [Wicket-user] getObjectAsString always null in 1.2.2

2006-10-02 Thread kurt heston
Am I being too vague here to get an answer?  Do I need to post my code?

kurt heston wrote:
> All I did was switch from wicket-1.2-rc3.jar to wicket-1.2.2.jar and my 
> SignIn page, adapted from  Juergen's code, stopped working.  The fields 
> are always an empty string.
>
> What did I miss in the release notes?
>
> -
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ___
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>   

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user