wood burning stoves 2.0*
The moose likes JSF and the fly likes integration of struts- jsf  Problem related t url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "integration of struts- jsf  Problem related t url" Watch "integration of struts- jsf  Problem related t url" New topic
Author

integration of struts- jsf Problem related t url

Nishita Jain
Ranch Hand

Joined: Mar 30, 2006
Posts: 97
hello,
i am integrating struts jsf application. in that
a page has this kind of url
http://localhost:8080/TestMaster-jsf/jsp/addUser.faces

now when i process that page it gets converted into

http://localhost:8080/TestMaster-jsf/SelectTest.do

this may be because of the page which i process has no jsf tags.
but due to dat i cant do next processing.
Do i have any way that i can get like http://localhost:8080/TestMaster-jsf/SelectTest.faces.

in my struts.config i have
<action path="/SelectTest"
type="AddUserAction"
validate="true"
input="/jsp/addUser.faces"

scope="session" >

<forward name="success" path="/jsp/selectTestForUser.faces" />

</action>
here i have one more question

here the page goes to selectTestForUser.faces
but originally page has extension like selectTestForUser.jsp
so i m confuse how it has managed to redirect to jsp page.

Thanks


Nishita
Luis Felipe Bacca Arango
Greenhorn

Joined: May 26, 2003
Posts: 27
Hello Nishita,

First at all, you have to put the code of the pages in the forum so the people can see waht are you doing.

Note that you are using your local address to try to show us your test application, but with that address only you can view the problem.

I integrated struts with jsf so if you show your problem i can help.

Regards.


Luis Felipe.<br /> <br />SCJP, SCWCD.
Nishita Jain
Ranch Hand

Joined: Mar 30, 2006
Posts: 97
hello Luis,
thanks for coming forward to help me.

Now here the thing is i didnt ment to check my application with the url i gave. i just want to show you people that how my url change when i have only struts coding in particular page.
the thing is that when i use jsf tags it creates url like
http/localhost:8080/TestMaster-jsf/jsp/addUser.faces
else if i use struts code it creates url as
/localhost:8080/TestMaster-jsf/jsp/addUser.do
so i just want to show the url difference.
i want url as.faces but not as .do

i tried one thing that
to combine code i just put faces view code in between struts code. here is my jsp code for that


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/jsf_core.tld" prefix="f" %>
<%@ taglib uri="/WEB-INF/html_basic.tld" prefix="h" %>
<%@ taglib uri="/WEB-INF/struts-faces.tld" prefix="s" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>




<f:view>
<jsp:include page="header.jsp"/>
<s:loadMessages var="messages"/>
<s:html>
<head>
<title>
<s:message key="addUser.title" />
</title>
</head>
<body bgcolor="white">
<center>
<font size="6"> <s:message key="addUser.header" /></font>

<h:messages style="color: red"/>

<font color="red"><s:errors /></font>

<s:form id="testBean" action="/SelectTest" >
<html:form action="/SelectTest" method="post" >
<h3><center>Select Test</center></h3>
<table width="100%" cellpadding="3" border="1">
<tr>
<td><b>Test Name</b></td>
<td><b>Test Description</b></td>
<td><b>Test Creation Date</b></td>
<td><b>Action</b></td>
</tr>
<logic:iterate id="listing" name="listing">
<tr>
<td><bean:define id="temp" name="listing" property="testId" />
<%
String testid = temp+"";
%>
<bean:write name="listing" property="testName"/></td>
<td><bean:write name="listing" property="description"/></td>
<td><bean:write name="listing" property="testCreationDate"/></td>
<td><html:checkbox value="<%=testid%>" property="selectedTest" /></td>
</tr>
</logic:iterate>
</table>
<html:hidden property="mode" value="SELECTTEST" />
<br><center>
<html:submit value="Save" property="Save" />
<h:commandButton id="submit" type="SUBMIT" value="Submit"/>
<html:button value="Cancel" property="Cancel" />
</center>
</html:form>
</s:form>
</center>
</body>
</s:html>
</f:view>

this code is mess up as i put everything.
when i tried this code the page submits itself without calling any action. i know in this code 2 actions ,2 submit buttons are there . but i was just finding out the solution.
This is it.

Thanks in advance.
-Nishita
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: integration of struts- jsf Problem related t url