wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo <irresistible...@gmail.com>
Subject Variable changes on server running, don't change on localhost
Date Thu, 10 Jan 2013 14:51:15 GMT
Hi,
I am become crazy!

My wicket web application works fine on my laptop on localhost,
but don't work well on my home server.

I made all the web site stateless. I don't need user login. But one page is stasefull because
I use wicket Ajax Tab Panel. On this page I have youtube video, with some panels that give
informations
about the selected video, taken from youtube API using java. The first panel give information
like title, author, views, ecc.
The second panel give comments of that video, ecc.

My problem is that when user pass from first panel to second panel, the comments returned
is related to another video!
When come back to first panel the information changes and it is relative to another video
too!
It looks totally random! But I think that the information on the actual panel is related to
video selected by another user connected to my web site.
I known that there are user connected to my server every second, just because I can see upload
bandwith used by system information graphic, and I
know by Google Analytics that every day I have about 500 users connected.

Infact when I test the application on my laptop on localhost it works well, all things is
ok, and I am the only user of course.

How can I do some check to understand well the problem?
How can I solve the problem?
In my application I don't manage the Session, because I don't need, and I know that wicket
automatically create a Session, infact
on ajax page I can see jsession=xxxxx in the url.
How can I know more instant informations about how many users connected and what pages that
users are wacthing now?

I use wicket 6.2.0, Tomcat 6.2.4, Eclipse EE,  Linux, Home server and ADSL (1Mbit Upload)

Some part of code:

package org.apache.wicket.examples.authentication3;

import ....

public class V extends BasePage implements Serializable
{	private static final long serialVersionUID = 1L;
	public static String v, page;
	public static String titolo,autore,data,descrizione,descr,uploader,videoid;
	public static String visualiz = "---", sottoscr = "---", durata="";
	public static long secondi;
	public static long count;
	public static int pageINT;
	public static int max_results;
	
	public V()
		{
			this ( new PageParameters() );
		}

	public V(PageParameters inparams) {
	v = inparams.get("v").toString();
    System.out.println ("v:"+v);
...
add(new Menu("panel",null,inparams.get("in").toString()));  // INCLUDE DIV SUPERIORE DELLA
BARRA DI RICERCA


    List tabs = new ArrayList();
    tabs.add(new AbstractTab(new Model("Info Video"))
    {
    public Panel getPanel(String panelId)
    {
    return new TabPanel1(panelId);
    }
    });

    tabs.add(new AbstractTab(new Model("Comments"))
    {
    public Panel getPanel(String panelId)
    {
    return new TabPanel2(panelId);
    }
    });

    tabs.add(new AbstractTab(new Model("Download video or mp3"))
    {
    public Panel getPanel(String panelId)
    {
    return new TabPanel3(panelId);
    }
    });

    add(new AjaxTabbedPanel("tabs", tabs));
    
 // tabsdx  TabPanel di destra: Video correlati e Video dell'autore
    
    List tabsdx = new ArrayList();
    tabsdx.add(new AbstractTab(new Model("Related Video"))
    {
    public Panel getPanel(String panelId)
    {
    return new TabPaneldx1(panelId);
    }
    });

    tabsdx.add(new AbstractTab(new Model("Same author Video"))
    {
    public Panel getPanel(String panelId)
    {
    return new TabPaneldx2(panelId);
    }
    });
    add(new AjaxTabbedPanel("tabsdx", tabsdx));

...

	VideoEntry ve = null;
	try
	{
		YouTubeService service = new YouTubeService("gdataSample-YouTube-2");
		ve = service.getEntry(new URL("http://gdata.youtube.com/feeds/api/videos/"+v), VideoEntry.class);
			System.out.println("Service v=" + v);
	}
	catch (MalformedURLException e) { e.printStackTrace(); }
	catch (IOException e) { e.printStackTrace(); }
	catch (ServiceException e) { e.printStackTrace(); } 

...
private static class TabPanel1 extends Panel                  // Tab Info Video
{
public TabPanel1(String id)
{
super(id);
//...
System.out.println ("tab1 v:"+v);
System.out.println ("tab1 videoid:"+videoid);

add(new Label("VideoTitoloTab",titolo)); 
add(new Label("VideoDescrTab",descrizione)); 
add(new Label("VideoData",data));
add(new Label("VideoVisualizzazioni",visualiz)); 
add(new Label("VideoSottoscrizioni",sottoscr)); 

PageParameters outparamslink13 = new PageParameters(); outparamslink13.add("v", videoid);
outparamslink13.add("in", "video"); // outparamsl1.add("page", (pageINT+1));
add(new  BookmarkablePageLink("link13", V.class, outparamslink13).setBody(Model.of(autore)));

...

private static class TabPanel2 extends Panel  				 // COMMENTI
{
public TabPanel2(String id)
{
super(id);
/**
 * Prints the comments feed of a VideoEntry.

 */

System.out.println ("tab2 v:"+v);
System.out.println ("tab2 videoid:"+videoid);

Feed feed = null;
try
{
	YouTubeService service = new YouTubeService("gdataSample-YouTube-2");
	feed = service.getFeed(new URL("https://gdata.youtube.com/feeds/api/videos/"+videoid+"/comments?v=2&start-index="+((pageINT-1)*25+1)),
Feed.class);
    System.out.println("\tURLLLL: " + ((pageINT-1)*25+1) );
}
...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message