• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

invoke ActionServlet as welcome page

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Anybody can help in the following problem?

I am using tiles framework.

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<tiles:insert page="/tiles/template.jsp" flush="true">
<tiles ut name="title" type="string" value="Welcome" />
<tiles ut name="header" value="top.jsp" />
<tiles ut name="menu" value="left.jsp" />
<tiles ut name="body" value="capacity.jsp" />
<tiles ut name="bottom" value="bottom.jsp" />
</tiles:insert>



I have single JSP page to display i.e capacity.jsp. Directely it should come when I invoke URl like http://localhost:8080/capacity.

Now, here problem is, I can't make it as welcome page in web.xml. Because in that, data are coming from Action class. So, first Action class needs to be invoked and then data can be populated in this capacity.jsp.

In web.xml, I tried to invoke /capacity.do as welcome page. But it's not working. It's showing directory structure of capacity folder.

Instead of this, can I use,

<tiles ut name="body" value="capacity.do" />

in the above tiles structure?

Please help me on this.

Dhara
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ability to use a virtual page (e.g. capacity.do) as opposed to a physical page (e.g. index.html) as a welcome page varies by Application server. I use WebSphere, and it does not support virtual pages as a welcome page, but others have told me that WebLogic does support them. I don't know about Tomcat.

Since you've obviously tried it and it doesn't work, your Application Server apparently doesn't support them.

Here is the workaround I have used:

Create an index.html page and put index.html in the welcome file list. Then put the following line in the <head></head> block of your page:

<meta http-equiv="refresh" content="2;url=capacity.do">

This causes the page to redirect to the URL you specify after waiting 2 seconds.
 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic