You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by arockiasamy <ar...@object-frontier.com> on 2006/12/08 06:15:12 UTC
doubt on beehive package structure
Hi..
i need one clarification , regarding package structure in beehive.
1) whether i should have package structure as mentioned in doc or 2) i can
have src package(controller files(.java)) and web package (.jsp ) files
separately.
Is it possible in beehive1.0.1 ? clear my doubts
for example
src
welcomepkg
Controller.java
beehivepkg
Controller.java
Loginpkg
handler.java
web
welcomepkg
index.jsp
resourcepkg
error.jsp
loginwelcomepkg
index.jsp
success.jsp
WEB-INF
tld
lib
is it possible in 1.0.1?
i would be happy if u clear my doubts, bcos i am not getting this one
regards
sam
web.xml
--
View this message in context: http://www.nabble.com/doubt-on-beehive-package-structure-tf2778826.html#a7752909
Sent from the Beehive - User mailing list archive at Nabble.com.
Re: doubt on beehive package structure
Posted by arockiasamy <ar...@object-frontier.com>.
Hi srinivas
Thanks, but when i do so i am getting error in <netui:form
action="processLogin"> in this place, denoting that
invalid action form. but i have done as in doc i.e
http://beehive.apache.org/docs/1.0.1/netui/tutorial.html#ceate
In my controller i have like this
@Jpf.Controller(
simpleActions = {
@Jpf.SimpleAction(name="begin", path="/pageflow/index.jsp"),
@Jpf.SimpleAction(name="login", path="/pageflow/login.jsp" )
}
)
public class Controller
extends PageFlowController {
@Jpf.Action (
forwards= {
@Jpf.Forward(name="success", path ="/pageflow/display.jsp")
}
)
public Forward processLogin(LoginForm loginForm) {
log("UserName : " + loginForm.getUserName());
log("Designation : " + loginForm.getDesignation());
Forward fwd = new Forward("success");
fwd.addActionOutput("userName", loginForm.getUserName());
fwd.addActionOutput("designation", loginForm.getDesignation());
return fwd;
}
private static void log(Object o) {
if (o instanceof Throwable) {
((Throwable)o).printStackTrace(System.err);
} else {
System.out.println(o + "");
}
}
}
package structure is
src
pageflow
Controller.java
bean
LoginForm.java
web
pageflow
Login.jsp
dispaly.jsp
index.jsp
WEB-INF
...
my login.jsp contains
<%@ page language="java" contentType="text/html;
charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri = "/WEB-INF/tld/beehive-netui-tags-html.tld" prefix ="netui"
%>
<netui:html>
<netui:body>
<p>
Hi Welcome!!!
</p>
<p>
<netui:form action="processLogin">
<table>
<tr>
<td>username:</td>
<td><netui:textBox
dataSource="actionForm.userName"/></td>
</tr>
<tr>
<td>Designation:</td>
<td><netui:textBox
dataSource="actionForm.designation"/></td>
</tr>
</table>
<br/>
<netui:button value="Submit"/>
</netui:form>
</p>
</netui:body>
</netui:html>
My index.jsp has <netui:anchor action ="login">Login</netui:anchor>
when i hit http://localhost:8080/<contextname>/pageflow/begin.do? i
am getting index.jsp
after clicking login link in index.jsp, i am getting "action:processLogin
invalid action".. repeatly such error i am getting.
what is the error in program ?..what is the error in <netui:form> kindly
help me
with expectation
regards
sam
srinivas-s wrote:
>
> We are putting the java and jsp files in different directories
>
>
> Here is the snippet from the beehive docs page
>
> You can find the below in
> http://beehive.apache.org/docs/1.0.1/netui/tutorial.html#ceate
>
> Note
> Here we have put our controller class directly in the web content
> directory, alongside its pages. If you would rather not do this (or if you
> can't because your IDE doesn't like it), you can put the controller class
> in a parallel source directory. In this case, you would put it in
> src/myFlow, and NetUI will assume it goes with pages that are in
> web/myFlow.
>
>
>
> -------------- Original message --------------
> From: arockiasamy <ar...@object-frontier.com>
>
>>
>> Hi..
>>
>> i need one clarification , regarding package structure in beehive.
>> 1) whether i should have package structure as mentioned in doc or 2) i
>> can
>> have src package(controller files(.java)) and web package (.jsp ) files
>> separately.
>>
>> Is it possible in beehive1.0.1 ? clear my doubts
>>
>> for example
>>
>> src
>> welcomepkg
>> Controller.java
>> beehivepkg
>> Controller.java
>> Loginpkg
>> handler.java
>> web
>> welcomepkg
>> index.jsp
>> resourcepkg
>> error.jsp
>> loginwelcomepkg
>> index.jsp
>> success.jsp
>> WEB-INF
>> tld
>> lib
>> is it possible in 1.0.1?
>>
>> i would be happy if u clear my doubts, bcos i am not getting this one
>>
>> regards
>> sam
>>
>>
>> web.xml
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/doubt-on-beehive-package-structure-tf2778826.html#a7752909
>> Sent from the Beehive - User mailing list archive at Nabble.com.
>>
>
--
View this message in context: http://www.nabble.com/doubt-on-beehive-package-structure-tf2778826.html#a7794543
Sent from the Beehive - User mailing list archive at Nabble.com.