Re: including wicket component into jsp

2010-06-28 Thread rikizz

Hi,

thanks for the reply. Yes i checked, and the wicket filter is called but
debugging wicket code i found that is not calling the onrender method. I
will investigate to find out way..
If anyone has a working example it would be great..
thanks
riccardo

On 28 June 2010 19:40, bht [via Apache Wicket] <
ml-node+2271310-405062206-282...@n4.nabble.com
> wrote:

> Have you checked that the wicket filter is called?
>
> I found that the struts filter does not call filterChain.doFilter().
> That may or may not be your problem depending whether anything else is
> in its path after it. I suspect however that this is what you need
> otherwise how can Wicket get the request if the wicket filter is not
> called?
>
> Regards
>
> Bernard
>
> On Mon, 28 Jun 2010 10:54:38 -0700 (PDT), you wrote:
>
> >
> >Hi all,
> >
> >I know the many posts have been written on the same problem, but I have
> been
> >looking at the answers for 5 hours without having a simple example to work
>
> >with..
> >I basically need to include a single component (a menu) into my jsp pages,
>
> >because we are migrating the application from struts/jsp to wicket.
> >I tried with the following code but it didn't work:
> >
> >WICKET APPLICATION:
> >
> >public class WicketApplication extends WebApplication
> >{
> > public WicketApplication(){}
> > public Class getHomePage(){ return HomePage.class;}
> > @Override
> > protected void init(){
> > getMarkupSettings().setStripWicketTags(true);
> >
> >getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);
>
> > }
> >}
> >
> >
> >PAGE MARKUP:
> > >xmlns:wicket="
> http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";
> >>
> >
> >Wicket Quickstart Archetype Homepage
> >
> >
> >Wicket Quickstart Archetype Homepage
> >
> >message will be here
> >
> >
> >
> >PAGE CODE:
> >
> >public class HomePage extends WebPage {
> >public HomePage(final PageParameters parameters) {
> >add(new Label("message", "If you see this message wicket is
> properly
> >configured and running"));
> >}
> >@Override
> >protected void onRender(final MarkupStream markupStream){
> > System.out.println("RENDER OF THE PAGE!!");
> >}
> >}
> >
> >JSP PAGE:
> >
> >
> >WEB.XML:
> >
> >
> > 
> > wicket.embedwicket
> > embedwicket.WicketMenuFilter
> > 
> > applicationClassName
> > embedwicket.WicketApplication
> > 
> > 
> >
> > 
> >  wicket.embedwicket
> > /wic/*
> > INCLUDE
> > REQUEST
> > FORWARD
> > 
> >
> >
> >
> >WicketMenuFilter:
> >THIS IS MY CUSTOM WICKET FILTER TO MANAGE INCLUDE URI, AS IT WAS SUGGESTED
>
> >BY A GUY HERE:
> >
> http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
> >
> http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
>
> >
> >Basically I overrided the method
> >public String getRelativePath(HttpServletRequest request)
> >
> >buy copying it and replacing the following lines:
> >
> >String path = Strings.stripJSessionId(request.getRequestURI());
> >String contextPath = request.getContextPath();
> >
> >with:
> >
> >String requestURI = (String)
> >request.getAttribute("javax.servlet.include.request_uri");
> >if (requestURI == null) {
> > requestURI = request.getRequestURI();
> >}
> >String path = Strings.stripJSessionId(requestURI);
> >
> >
> >I tried to debug the code and the filter is called, but then nothing is
> >displayed on the browser.. just a blank page..
> >If I call page directly(not the jsp) , it renders correctly..
> >
> >
> >
> >Has anyone got a simple working example of this situation?
> >
> >I would really appreciate id because I am going crazy..
> >
> >Thank you very much.
> >
> >Riccardo
>
>
> -
> To unsubscribe, e-mail: [hidden 
> email]
> For additional commands, e-mail: [hidden 
> email]
>
>
>
> --
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/including-wicket-component-into-jsp-tp2271266p2271310.html
> To unsubscribe from including wicket component into jsp, click 
> here.
>
>
>

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/including-wicket-component-into-jsp-tp2271266p2271389.html
Sent from the Wicket - User mailing list archive at Nabble.com.


including wicket component into jsp

2010-06-28 Thread rikizz

Hi all,

I know the many posts have been written on the same problem, but I have been
looking at the answers for 5 hours without having a simple example to work
with..
I basically need to include a single component (a menu) into my jsp pages,
because we are migrating the application from struts/jsp to wicket.
I tried with the following code but it didn't work:

WICKET APPLICATION:

public class WicketApplication extends WebApplication
{
public WicketApplication(){}
public Class getHomePage(){   return HomePage.class;}
@Override
protected void init(){
getMarkupSettings().setStripWicketTags(true);

getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);
}
}


PAGE MARKUP:
http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";
>
  
Wicket Quickstart Archetype Homepage


Wicket Quickstart Archetype Homepage

message will be here



PAGE CODE:

public class HomePage extends WebPage {
public HomePage(final PageParameters parameters) {
add(new Label("message", "If you see this message wicket is properly
configured and running"));
}
@Override
protected void onRender(final MarkupStream markupStream){
System.out.println("RENDER OF THE PAGE!!");
}
}

JSP PAGE:


WEB.XML:



wicket.embedwicket
embedwicket.WicketMenuFilter

applicationClassName
embedwicket.WicketApplication



 
  wicket.embedwicket
/wic/*
INCLUDE
REQUEST
FORWARD
 



WicketMenuFilter:
THIS IS MY CUSTOM WICKET FILTER TO MANAGE INCLUDE URI, AS IT WAS SUGGESTED
BY A GUY HERE:
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
 

Basically I overrided the method
public String getRelativePath(HttpServletRequest request)

buy copying it and replacing the following lines:

String path = Strings.stripJSessionId(request.getRequestURI());
String contextPath = request.getContextPath();

with:

String requestURI = (String)
request.getAttribute("javax.servlet.include.request_uri");
if (requestURI == null) {
requestURI = request.getRequestURI();
}
String path = Strings.stripJSessionId(requestURI);


I tried to debug the code and the filter is called, but then nothing is
displayed on the browser.. just a blank page..
If I call page directly(not the jsp) , it renders correctly..



Has anyone got a simple working example of this situation?

I would really appreciate id because I am going crazy..

Thank you very much.

Riccardo




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/including-wicket-component-into-jsp-tp2271266p2271266.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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