aspose file tools*
The moose likes BEA/Weblogic and the fly likes Struts Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Struts Help" Watch "Struts Help" New topic
Author

Struts Help

srinivasM Reddy
Greenhorn

Joined: May 23, 2005
Posts: 5
Hi all,

if you have any url for Deploying struts application in Weblogic please
send me the Link

thanks
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Where are you stuck? Are you new to struts or weblogic?

If you've got a weblogic domain set up you can drop one of the struts example war files into the applications directory.

http://e-docs.bea.com/platform/docs81/index.html
srinivasM Reddy
Greenhorn

Joined: May 23, 2005
Posts: 5
Hi , i am trying to deploy a sample application using struts in weblogic
The file details are as follows:
IF u can help me , i need to run this files in weblogic,
can u tell me what should i do to run this files..



FIle Name :
------------------------------------------------------------------
<%@ page language="java" %>
<%@ 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" %>

<html>
<head><title>Submit example</title></head>
<body>

<h3>Example Submit Page</h3>

<html:errors/>

<html:form action="submit.do">
Last Name: <html:text property="lastName"/><br>
Address: <html:textarea property="address"/><br>
Sex: <html:radio property="sex" value="M"/>Male
<html:radio property="sex" value="F"/>Female<br>
Married: <html:checkbox property="married"/><br>
Age: <html:select property="age">
<html ption value="a">0-19</html ption>
<html ption value="b">20-49</html ption>
<html ption value="c">50-</html ption>
</html:select><br>
<html:submit/>
</html:form>

</body>
</html>
-------------------------------------------------------------
file ;; SubmitAction

package aaaa;

import javax.servlet.http.*;
import org.apache.struts.action.*;

public final class SubmitAction extends Action {

public ActionForward perform(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {

SubmitForm f = (SubmitForm) form; // get the form bean
// and take the last name value
String lastName = f.getLastName();
// Translate the name to upper case
//and save it in the request object
request.setAttribute("lastName", lastName.toUpperCase());

// Forward control to the specified success target
return (mapping.findForward("success"));
}
}
-----------------------------------------------------------------

file name : SubmitForm

package aaaa;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;

public final class SubmitForm extends ActionForm {

/* Last Name */
private String lastName = "Hansen"; // default value
public String getLastName() {
return (this.lastName);
}
public void setLastName(String lastName) {
this.lastName = lastName;
}

/* Address */
private String address = null;
public String getAddress() {
return (this.address);
}
public void setAddress(String address) {
this.address = address;
}

/* Sex */
private String sex = null;
public String getSex() {
return (this.sex);
}
public void setSex(String sex) {
this.sex = sex;
}

/* Married status */
private String married = null;
public String getMarried() {
return (this.married);
}
public void setMarried(String married) {
this.married = married;
}

/* Age */
private String age = null;
public String getAge() {
return (this.age);
}
public void setAge(String age) {
this.age = age;
}

}

---------------------------------------------------------------
file struts config file..


<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">

<struts-config>

<!-- ========== Form Bean Definitions ================= -->
<form-beans>

<form-bean name="submitForm"
type="aaaa.SubmitForm"/>

</form-beans>

<!-- ========== Action Mapping Definitions ============ -->
<action-mappings>

<action path="/submit"
type="aaaa.SubmitAction"
name="submitForm"
input="/submit.jsp"
scope="request">
<forward name="success" path="/submit.jsp"/>
<forward name="failure" path="/submit.jsp"/>
</action>

</action-mappings>

</struts-config>
----------------------------------------------------------------------
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Sorry, I'm not going to carefully read through 150 lines of code/configuration when you don't say what problem you are having with it today.

In your duplicate posts from yesterday, Struts forum - problem with struts in weblogic and BEA/Weblogic Forum - weblogic and struts usage error you were getting an exception with this message:


cannot resolve '/WEB-INF/struts-html.tld' into a valid tag library


Are you still having this problem? Are the struts tld files in WEB-INF and the jars in WEB-INF/lib?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Help
 
Similar Threads
URL rewrite to maintain session state
Struts interview questions
Action class in Struts
InnerHTML and struts tags
Eclipse IDE - How to set up a Struts 2 project