how to properly assign ActionBean to root url?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how to properly assign ActionBean to root url?

Noobmeter Admin
I'm trying to display some dynamic information on the http://www.mywebsite.com/ screen (so "/" URL) and it doesn't seem to work. In this example the root() handler is called, but ${actionBean} in JSP is empty.


RootActionBean.java:

@UrlBinding("/")
public class RootActionBean extends BaseActionBean {
@DefaultHandler
public Resolution root() {
return new ForwardResolution("index.jsp");
}
}

index.jsp:

<%@ page contentType="text/html; charset=UTF-8" %> 

<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>

<stripes:layout-render name="/layout/default.jsp">
<stripes:layout-component name="contents">
Context: ${actionBean.context}
</stripes:layout-component>
</stripes:layout-render>

However, if I change @UrlBinding("/") to @UrlBinding("/asdf") then for http://www.mywebsite.com/asdf everything works fine.

I'm using Jetty.

Any help will be appreciated!

Regards,
John


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: how to properly assign ActionBean to root url?

Janne Jalkanen

You have to use the DynamicMappingFilter.


/Janne

On Dec 29, 2012, at 12:50 , Noobmeter Admin <[hidden email]> wrote:

I'm trying to display some dynamic information on the http://www.mywebsite.com/ screen (so "/" URL) and it doesn't seem to work. In this example the root() handler is called, but ${actionBean} in JSP is empty.


RootActionBean.java:

@UrlBinding("/")
public class RootActionBean extends BaseActionBean {
@DefaultHandler
public Resolution root() {
return new ForwardResolution("index.jsp");
}
}

index.jsp:

<%@ page contentType="text/html; charset=UTF-8" %> 

<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>

<stripes:layout-render name="/layout/default.jsp">
<stripes:layout-component name="contents">
Context: ${actionBean.context}
</stripes:layout-component>
</stripes:layout-render>

However, if I change @UrlBinding("/") to @UrlBinding("/asdf") then for http://www.mywebsite.com/asdf everything works fine.

I'm using Jetty.

Any help will be appreciated!

Regards,
John

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: how to properly assign ActionBean to root url?

Noobmeter Admin
In reply to this post by Noobmeter Admin
Yes, I'm using it. But it doesn't seem to help.

Any other ideas? 

Regards,
John

From: Janne Jalkanen <Janne.Jalkanen@...>
Subject: Re: how to properly assign ActionBean to root url?
Newsgroups: gmane.comp.java.stripes.user
Date: 2012-12-29 15:03:41 GMT (4 hours and 16 minutes ago)


You have to use the DynamicMappingFilter.


/Janne

On Dec 29, 2012, at 12:50 , Noobmeter Admin <[hidden email]> wrote:

I'm trying to display some dynamic information on the http://www.mywebsite.com/ screen (so "/" URL) and it doesn't seem to work. In this example the root() handler is called, but ${actionBean} in JSP is empty.


RootActionBean.java:

<at> UrlBinding("/")
public class RootActionBean extends BaseActionBean {
<at> DefaultHandler
public Resolution root() {
return new ForwardResolution("index.jsp");
}
}

index.jsp:

<% <at> page contentType="text/html; charset=UTF-8" %> 

<% <at> taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>

<stripes:layout-render name="/layout/default.jsp">
<stripes:layout-component name="contents">
Context: ${actionBean.context}
</stripes:layout-component>
</stripes:layout-render>

However, if I change  <at> UrlBinding("/") to  <at> UrlBinding("/asdf") then for http://www.mywebsite.com/asdf everything works fine.

I'm using Jetty.

Any help will be appreciated!

Regards,
John


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: how to properly assign ActionBean to root url?

Janne Jalkanen

Can you post your web.xml config, please? My suspicion is that there may be a problem with the configuration.

/Janne

On Dec 29, 2012, at 21:40 , Noobmeter Admin <[hidden email]> wrote:

Yes, I'm using it. But it doesn't seem to help.

Any other ideas? 

Regards,
John

From: Janne Jalkanen <Janne.Jalkanen@...>
Subject: Re: how to properly assign ActionBean to root url?
Newsgroups: gmane.comp.java.stripes.user
Date: 2012-12-29 15:03:41 GMT (4 hours and 16 minutes ago)


You have to use the DynamicMappingFilter.


/Janne

On Dec 29, 2012, at 12:50 , Noobmeter Admin <[hidden email]> wrote:

I'm trying to display some dynamic information on the http://www.mywebsite.com/ screen (so "/" URL) and it doesn't seem to work. In this example the root() handler is called, but ${actionBean} in JSP is empty.


RootActionBean.java:

<at> UrlBinding("/")
public class RootActionBean extends BaseActionBean {
<at> DefaultHandler
public Resolution root() {
return new ForwardResolution("index.jsp");
}
}

index.jsp:

<% <at> page contentType="text/html; charset=UTF-8" %> 

<% <at> taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>

<stripes:layout-render name="/layout/default.jsp">
<stripes:layout-component name="contents">
Context: ${actionBean.context}
</stripes:layout-component>
</stripes:layout-render>

However, if I change  <at> UrlBinding("/") to  <at> UrlBinding("/asdf") then for http://www.mywebsite.com/asdf everything works fine.

I'm using Jetty.

Any help will be appreciated!

Regards,
John

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: how to properly assign ActionBean to root url?

chris-c
In reply to this post by Noobmeter Admin
I was not able to make it work either, and recommended solution was to put "index.jsp" in "WebContent" folder, and inside index.jsp include the actionbean,

for example in index.jsp I have:
<%@page contentType="text/html;charset=UTF-8" language="java" trimDirectiveWhitespaces="true"%>
<jsp:include page="/HomeAction"/>


On Sat, Dec 29, 2012 at 5:50 AM, Noobmeter Admin <[hidden email]> wrote:
I'm trying to display some dynamic information on the http://www.mywebsite.com/ screen (so "/" URL) and it doesn't seem to work. In this example the root() handler is called, but ${actionBean} in JSP is empty.


RootActionBean.java:

@UrlBinding("/")
public class RootActionBean extends BaseActionBean {
@DefaultHandler
public Resolution root() {
return new ForwardResolution("index.jsp");
}
}

index.jsp:

<%@ page contentType="text/html; charset=UTF-8" %> 

<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>

<stripes:layout-render name="/layout/default.jsp">
<stripes:layout-component name="contents">
Context: ${actionBean.context}
</stripes:layout-component>
</stripes:layout-render>

However, if I change @UrlBinding("/") to @UrlBinding("/asdf") then for http://www.mywebsite.com/asdf everything works fine.

I'm using Jetty.

Any help will be appreciated!

Regards,
John


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: how to properly assign ActionBean to root url?

Noobmeter Admin
In reply to this post by Noobmeter Admin
Cristian,

Thanks - this works and is a nice solution!

Regards,
John.

> ---------- Forwarded message ----------
> From: Cristian C <[hidden email]>
> To: Stripes Users List <[hidden email]>
> Cc:
> Date: Sat, 29 Dec 2012 14:59:46 -0500
> Subject: Re: [Stripes-users] how to properly assign ActionBean to root url?
> I was not able to make it work either, and recommended solution was to put "index.jsp" in "WebContent" folder, and inside index.jsp include the actionbean,
>
> for example in index.jsp I have:
> <%@page contentType="text/html;charset=UTF-8" language="java" trimDirectiveWhitespaces="true"%>
> <jsp:include page="/HomeAction"/>

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users