• 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

Running sample Beehive NetUI Tutorial using Tomcat

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to run a simple page flow using tomcat 5.5.25 but I am not able to run a controller. I am able to run my JSP but not contorller.jpf.
Please somebody help me.

Jsp:

<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
<netui:html>
<head>
<title>Web Application Page</title>
<netui:base/>
</head>
<netui:body>
<p>
Testing
</p>
</netui:body>
</netui:html>

Controller.java:

import javax.servlet.http.HttpSession;

import org.apache.beehive.netui.pageflow.PageFlowController;
import org.apache.beehive.netui.pageflow.annotations.Jpf;


@Jpf.Controller(
simpleActions={
@Jpf.SimpleAction(name="begin", path="Rajesh.jsp")
}

)
public class Controller
extends PageFlowController
{
/**
* Method that is invoked when this controller instance is created.
*/
protected void onCreate()
{
}

/**
* Method that is invoked when this controller instance is destroyed.
*/
protected void onDestroy(HttpSession session)
{
}
}


-------------
Web.xml:

<?xml version="1.0" encoding="UTF-8" ?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.

$Header:$
-->
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<display-name>ana</display-name>

<!-- Filter to perform Page Flow operations when JSPs are hit directly. -->
<filter>
<filter-name>PageFlowJspFilter</filter-name>
<filter-class>org.apache.beehive.netui.pageflow.PageFlowJspFilter</filter-class>
</filter>

<!-- Filter to perform Page Flow operations when JavaServer Faces pages are hit directly. -->
<filter>
<filter-name>PageFlowFacesFilter</filter-name>
<filter-class>org.apache.beehive.netui.pageflow.PageFlowFacesFilter</filter-class>
</filter>

<!--
It is possible - but certainly not required - to keep source files such as page flows and
JavaServer Faces backing beans mixed in with web content. In this case, and when the web
content directory itself is being deployed without being copied to some other build
location, it is important to prevent the source code from being URL-addressable. This
filter returns a specified error code when source files are requested.
-->
<filter>
<filter-name>PageFlowForbiddenFilter</filter-name>
<filter-class>org.apache.beehive.netui.pageflow.PageFlowForbiddenFilter</filter-class>
<init-param>
<param-name>response-code</param-name>
<param-value>404</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>PageFlowJspFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

<filter-mapping>
<filter-name>PageFlowJspFilter</filter-name>
<url-pattern>*.jspx</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

<filter-mapping>
<filter-name>PageFlowFacesFilter</filter-name>
<url-pattern>*.faces</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

<filter-mapping>
<filter-name>PageFlowFacesFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

<!-- Prevent URL access to Java source code. -->
<filter-mapping>
<filter-name>PageFlowForbiddenFilter</filter-name>
<url-pattern>*.java</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

<!-- Prevent URL access to JavaServer Faces backing beans. -->
<filter-mapping>
<filter-name>PageFlowForbiddenFilter</filter-name>
<url-pattern>*.jsfb</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

<!-- Prevent URL access to shared flow source files. -->
<filter-mapping>
<filter-name>PageFlowForbiddenFilter</filter-name>
<url-pattern>*.jpfs</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

<!-- Configuration/init listener for NetUI framework -->
<listener>
<listener-class>org.apache.beehive.netui.pageflow.PageFlowContextListener</listener-class>
</listener>

<!-- Listener to create NetUI framework HttpSession mutex objects -->
<listener>
<listener-class>org.apache.beehive.netui.pageflow.HttpSessionMutexListener</listener-class>
</listener>

<!-- NetUI Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/_pageflow/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<!-- The XmlHttpRequest handler Servlet -->
<servlet>
<servlet-name>XmlHttpRequestServlet</servlet-name>
<servlet-class>org.apache.beehive.netui.pageflow.xmlhttprequest.XmlHttpRequestServlet</servlet-class>
</servlet>

<!-- Struts Action Servlet Mappings -->
<!-- Note that because Struts takes the *last* mapping here as the extension to add to
actions posted from forms, we must have *.do come after *.jpf (etc.). -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.jpf</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- XmlHttpRequest Servlet -->
<servlet-mapping>
<servlet-name>XmlHttpRequestServlet</servlet-name>
<url-pattern>*.xhr</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>XmlHttpRequestServlet</servlet-name>
<url-pattern>*.render</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

------------------

I think I am missing something in my web.xml..
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm facing the same problem in tomcat 5.5. I'm able to see the index jsp from the default controller, but when I try to go to any action, it throwing below errors:

2009-05-15 10:10:45,856 [http-8085-Processor24] ERROR org.apache.beehive.netui.pageflow.AutoRegisterActionServlet - No module configuration registered for /general/usImmgrDetails.do (module path /general).

2009-05-15 10:10:45,856 [http-8085-Processor24] ERROR org.apache.beehive.netui.pageflow.internal.InternalUtils - Error (message key PageFlow_NoModuleConf) occurred. Response error was set to 404

Please advice. Thanks,
Arun
 
Arun Chinnaraju
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm able to run the controller. I just did copy the sample beehive project to run in tomcat and modified the code as per my project. thanks.

Beehive project has some build files which converting the jpf accordingly.

- Arun
 
I can't take it! You are too smart for me! Here is the 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