Struts framework & J2EE deploytool problem
When creating a new application in the J2EE deploytool with the example WAR file "struts-example.war" from the struts framework i can view this at "http://localhost:8000/example/" with no problem. However, when creating my own WAR file of the build struts framework example i get after deployment and calling "http://localhost:8000/example/" the following:
"javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE"
The WAR and EAR configs look exactly alike in the J2EE deploytool.
What bugging me is i can not find the problem.
Please inform
Thanbks
Thank you very much for the response.
As you mentioned I put the "ApplicationResources.properties" file in the classes directory, this gives me the same error.
However, i am using struts 1.1 if it matters and in web.xml the following is defined:
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
and in struts-config.xml :
<message-resources
parameter="org.apache.struts.webapp.example.ApplicationResources"/>
This is the directory where the "ApplicationResources.properties" also excists.
As mentioned the example war coming with the framework works fine, so i assume it is not related to any envioronment vars.
It is probably clear that i am new to all this. My objective is to determine whether my exising framework with a servlet session controlling usecase can be integrated with the strutsframework.
I thank you for your time
regards, Erwin
Similar Messages
-
Porting unix shell script to WEBUI having Struts framework
Hi,
I am working on an assignment where I have to migrate various unix shell scripts to web based application using struts framework(J2EE).
Is there any way to call the existing unix shell script thru the web based application?? so that the rewritting complexity can be reduced.
Any expert suggestion will be appreciated.
Thanks
RajThank you for reply ,
And sorry by mistake question repeated twice,
but when iam executing those batch files it is throwing some exceptions,
in that file you did not mention to set the JRE path whether it is not necessary and also there msoc05 is the machine name of unix system that need to kept or need to be changed with window IP address .please reply.
thanks in advance. -
Using Multiple Properties Files in Struts Framework
Hi Everybody!
I just to know how to use a multiple message-resources files in a Struts Framework.
I've 2 properties file :
1. ApplicationResources_A.properties
2. ApplicationResources_B.propertiesI put the files under WEB-INF/classes dir.
My configuration in struts-config file something like below:
<!-- Begin Testing -->
<message-resources key="A" parameter="ApplicationResources_A" />
<message-resources key="B" parameter="ApplicationResources_B" />
<!-- End Testing -->
</struts-config>
if my JSP code is like below , this error is thrown:
org.apache.jasper.JasperException: Cannot find message resources under key A
<tr>
<td width="17%">Language A</td>
<td width="83%"><bean:message bundle="A" key="user.lang.desc"/></td>
</tr>
<tr>
<td width="17%">Language B</td>
<td width="83%"><bean:message bundle="B" key="user.lang.desc"/></td>
</tr>
but if I change the JSP code like below it work fine:
<tr>
<td width="17%">Language A</td>
<td width="83%"><bean:message key="user.lang.desc"/></td>
</tr>
<tr>
<td width="17%">Language B</td>
<td width="83%"><bean:message key="user.lang.desc"/></td>
</tr>
In this code , I dont know which resources file is used.
So how do I solve this problem. Thanks you.I have defined the following:
struts-config.xml
<message-resources key="ldap" parameter="com/project/struts/ldap"/>
Action.java
In execute method:
MessageResources messageResources= MessageResources.getMessageResources("com/project/struts/ldap");
System.out.println("INITIAL_CONTEXT_FACTORY"+messageResources.getMessage("INITIAL_CONTEXT_FACTORY"));
and it is working, however I have to change "com/project/struts/ldap" value in Action.java file whenever there is any change in name or location of ldap.properties.
Can I access this properties in such way that I don't have to change parameter path manually in Action.java (modifying in struts-config.xml is okay)? like access through key="ldap" or something.
Thanks and regards, -
Hello All.
I am having trouble deploying a basic Java Server Faces appilcation...the problem seems to be in the deploytool utility.
Firstly it doesnt seem to detect all the file that are updated since the app was last deployed and hence I have to drag each one into the WAR....very tedious.
Secondly, the re seems to be some dependency between files!!! If you updated one and added it to the WAR you must update others as well.
Thirdly, the server does not allow me to access my app at random times i.e update a file, update the war, save, deplo and try to access the app...only to get a resource unavilable message.
I have a feeling this is a deploytool problem. I am using J2ee version 1.4 with SUNWappserver 8.
Any Ideas?
ThanksIn addition.....every time a update a file in the application, deploytool update one file that....with the wrong version!!! Which doesnt even exist anymore on the disk.....
Using this on Linux...Fedora core 2.... -
Can we use ejb in struts framework?
can we use ejb in struts framework?I need the reasons for both yes or no answers.
This question is not appropriate for this forum, which deals with the J2EE SDK. Have you looked at the Struts documentation? Have you performed a Google search? If you had, you would have found the answer....
-Ian Evans -
Populating Database values into a combo box in STRUTS Framework
Hi Guys,
I am currently working on a STRUTS Framework project and I can't get much resources related to the problems that I'm facing.
Currently I need to populate a JSP file's Combo box with database values. What I don't know here is the syntax used to in STRUTS framework to populate the Combo box with database values. Anyone with experience related to this topic, please kindly help me out.Struts doesn't define anything about the datab layer. You're free to implement how you will.
Struts instead guides you into following an MVC pattern.
You populate a combo box with values from a bean.
So you need to set up a bean for this page to talk to.
That bean can be populated from the database - but at that point you're in java/jdbc code - and away from the struts layer.
My suggestions
1 - Define a bean to represent the information from the database.
2 - write a method that queries the database, and copies the data into a List of those beans. This will be your Data access layer.
3 - in your action, call that method, and then set the list of beans as a request attribute. Or maybe as a property on a form.
4 - use that list of beans to populate your dropdown box. -
How Ajax works with Struts framework
How Ajax works with Struts framework .
Thanks
RamkiSo we must write file name(like abc.do), If am using struts <html:link > tag like <html:like action="abc" >Click</html:link>, so with ajax we must call like <a href ="abc.do">Click</a> .
But there is a problem, if am using ,
<servlet-mapping>
<servlet-name>MainServlet</servlet-name>
<url-pattern>/r/*</url-pattern>
</servlet-mapping>
or
<servlet-mapping>
<servlet-name>MainServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
here i am changing web.xml file based on client interest. At those situation we must change all jsp pages for <a href ="/r/abc">Click</a> .like,.
It's very difficult.
Is any other way to use ajax with Struts (Only struts tags)
Thanks
Ramki -
Developing WebApplication basing on Struts Framework
Hi,
We are developing an Web application. In our previous application we had used MVC1 architecture where we have one renderer for one .jsp page. Now we want to move to MVC2 architecture with struts framework at Controller level. I request a detailed documentation regarding this if any one has....
We are concerned about how to make the portal understand about our architecture. Do we need to follow any standard steps to for making the portal to understand that this application is been developed Struts framework.
We are using Oracle Portal 10.1.4 and Jdeveloper 10.1.3.2
Regards,
tulacenath.actionForm acForm =
(actionForm)request.getAttribute("ActionForm");
// i have added the form to session in my parent
pageNote the above Statements.....
>
>
When the page is loaded for the first time with
default search option chosen
its working fine. However, when the search option is
changed and the
search function is executed it leads to the error
page.
I tried step by step debugging and found that the
actionForm was null when
the search was performed second time.
How could i solve this problem? any ideas?for this remove ur reset method from bean class and manually do this.
( create another method to nullify values and call it when required )
AE -
Can i have multiple ActionServlet in a struts framework?
Can i have multiple ActionServlet in a struts framework?
if YES then please give me the sample configuration file..
thanks & Regards
raghavanYou can heve multiple actionServlet mappings in struts framework. but it not a good practice to use multiple ActionServlets. It will cause mapping problems later on.
-
Text Layout Framework columncount Undo problem
Text Layout Framework columncount Undo problem ::
The number of times columncount is changed it gets applied to textflow
and those number of operation is stored in undoStack(UndoManger).But when i
undo it, it comes back to intial state, without undoin step by step.
I have given my source code..
Y so or any other alternative to achieve this..
Thanx in advance..
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()">
<fx:Script>
<![CDATA[
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.conversion.ITextImporter;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.edit.EditManager;
import flashx.textLayout.edit.IEditManager;
import flashx.textLayout.edit.ISelectionManager;
import flashx.textLayout.edit.SelectionState;
import flashx.textLayout.elements.InlineGraphicElement;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.events.SelectionEvent;
import flashx.textLayout.events.StatusChangeEvent;
import flashx.textLayout.formats.Direction;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.undo.UndoManager;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.controls.CheckBox;
import mx.events.FlexEvent;
import mx.events.SliderEvent;
import spark.components.Group;
import spark.components.TextArea;
import spark.core.SpriteVisualElement;
public var directions:ArrayCollection = new
ArrayCollection(
{label:"Left-to-Right",
data:Direction.LTR},
{label:"Right-to-Left",
data:Direction.RTL}
private var _textContainer:SpriteVisualElement = null;
private static const textInput:XML = <TextFlow
xmlns="http://ns.adobe.com/textLayout/2008">
<div>
<p><span>The Text Layout Framework is
an extensible library, built on the new text engine in Adobe Flash Player 10,
which delivers advanced, easy-to-integrate typographic and text layout features
for rich, sophisticated and innovative typography on the web.
Some benefits provided by this framework
include: 1) rich typographical controls, including kerning, ligatures,
typographic case, digit case, digit width and discretionary hyphens
2) cut, copy, paste, undo and standard keyboard
and mouse gestures for editing 3) selection, editing and flowing text across
multiple columns and linked containers
4) bidirectional text, vertical text and over
30 writing scripts including Arabic, Hebrew, Chinese, Japanese, Korean, Thai,
Lao, Vietnamese, and others
5) vertical text, Tate-Chu-Yoko (horizontal
within vertical text) and justifier for East Asian typography. Try editing this
text and playing with the options below! Notice an inline image is also
included.</span></p>
</div>
</TextFlow>;
private var _textFlow:TextFlow;
private function init():void {
_textContainer = new SpriteVisualElement();
canvas.addElement(_textContainer);
var importer:ITextImporter =
TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
_textFlow = importer.importToFlow(textInput);
_textFlow.flowComposer.addController(new
ContainerController(_textContainer, canvas.width-40, canvas.height));
_textFlow.interactionManager = new
EditManager(new UndoManager());
_textFlow.flowComposer.updateAllControllers();
private function changeNoColumns(event:Event):void {
var tlf:TextLayoutFormat = new
TextLayoutFormat();
tlf.columnCount = cols.value;
tlf.columnGap = 15;
tlf.direction = direction.selectedItem.data;
var em:EditManager =
_textFlow.interactionManager as EditManager;
em.selectAll();
(_textFlow.interactionManager as
EditManager).applyFormat(tlf,tlf,tlf);
_textFlow.flowComposer.updateAllControllers();
protected function
undo_clickHandler(event:MouseEvent):void
var em:EditManager =
_textFlow.interactionManager as EditManager;
trace("Can undo " + em.undoManager.canUndo() +
" can redo " + em.undoManager.canRedo());
em.undo();
protected function
redo_clickHandler(event:MouseEvent):void
var em:EditManager =
_textFlow.interactionManager as EditManager;
trace("Can undo " + em.undoManager.canUndo() +
" can redo " + em.undoManager.canRedo());
em.redo();
]]>
</fx:Script>
<s:Panel title="Text Layout Framework Sample" width="100%"
height="100%">
<s:layout>
<s:VerticalLayout paddingTop="8" paddingLeft="8"/>
</s:layout>
<s:VGroup>
<s:Group id="canvas" width="600" height="200" />
<s:HGroup width="100%" verticalAlign="middle">
<s:Label text="# Columns:"/>
<s:NumericStepper id="cols" minimum="1"
maximum="20" snapInterval="1" change="changeNoColumns(event)" />
<s:Label text="Text Direction:"/>
<s:DropDownList id="direction"
change="changeTextDirection(event)" dataProvider="{directions}"
selectedItem="{directions[0]}"/>
<s:Button label="Undo"
click="undo_clickHandler(event)"/>
<s:Button label="Redo"
click="redo_clickHandler(event)"/>
</s:HGroup>
</s:VGroup>
</s:Panel>
</s:WindowedApplication>It cannot be reproduced with TLF 3.0 + SDK 4.5.
-
Dynamic Tree Creation using JSP, Struts framework
I urgently require tips/information/code snippet for creating a Dynamic Tree structure.
Tree is the hierarchical folder structure that we see in windows operating system.
Dynamic tree in the sense that all nodes shall be populated from database & a radio button shall be present at each node that can be selected & submitted to form.
Tree should be done using JSP (& if required Javascript).
I am using Struts framework .
[email protected]u need to know quite a few java technologies to make archieve your dream.
JDBC, dynamic array and JSP.
after reading tutorial regarding to these 3 materials, you should be able to get your job done. -
Oracle portal using JSF, JSP, Struts framework
Hi ,
Can anyone tell me how to build an oracle portal using JSF,Jsp and Struts Framework.
Also please provide any manual or documentation for developing oracle portal.
Thanks in Advance,
RaghavAt present, i think the best thing to do is to look at the example provided with the struts-faces integration taglib. I don't know any documentation about it.
http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/ -
Need to understand Struts Framework
Greetings everyone,
I am trying to understand how the entire Struts Framework works.
If I am running tomcat, is copying and pasting the WAR file into webapps directory the only way to install struts?
Since I am new to struts and was trying to understand how it works from ground up, I tried creating the neccessary files needed and copied the struts.jar into my web app's WEB-INF\lib folder.
Unfortunately, I kept on hitting errors.
Here is my app directory structure
1) MyApp/
- index.jsp
- displayname.jsp
2) WEB-INF/
- struts-config.xml
- struts-html.tld
- web.xml
3) WEB-INF/classes/example/
- NameAction.class
- NameForm.class
4) WEB-INF/lib/
- servlet-api.jar
- struts.jar
I am getting this error:
HTTP Status 404 - /StrutsActionForm/index.jsp
type Status report
message /StrutsActionForm/index.jsp
description The requested resource (/StrutsActionForm/index.jsp) is not available.
Apache Tomcat/5.5.20
I know it sounds silly but that's the only way I can truly understand the entire struts framework.
Your reply will be much appreciated.If you specify the appBase of your application in Tomcat's server.xml ,
or define a <Context>.xml and point the docBase to where ever your code's main directory is, you won't hae to create a WAR file and place it under WEB-INF each time you make any change.
This saves a lot of time and effort in the development envionment, especially when you make a change to JSP pages - you can just refresh the browser to see the changes instead of creating a WAR file just to see changes in JSPs.
Create a WAR file only when you are deploying your application to production / live website - a WAR file is not necessary in dev environment.
With the above set-up your project can be located outside and independent of Tomcat, as long as the appBase or docBase are pointing to the location of your project.
For tomcat related questions join the Tomcat User Mailing List
and for struts question Struts User Mailing List -
I want to Know More About Struts Framework
Hai i am kiran patil from tybca m.s.uni baroda
we have elective of struts framework i want to know in deep and as i am begineer i want to know more about it
thank you if u can help me
Regards,
kiranhttp://struts.apache.org/
-
Can I use J2EE deploytool with other vendors
This might be a stupid question for J2EE veterans but I was wandering whether I can use Sun�s J2EE deploytool with other J2EE servers like WebLogic for example.
Concretely I would like to set in deploytool different then default classes for topic connection factory and topic � is it possible?
Januszdeploying an EJB means generating code, where the AppServer steps into when the Bean is created, for example to do security checks,pooling, resource management, ...
This is always AppServer specific.
Ina
Maybe you are looking for
-
Adding '-Select-' on top for a drop down box
Hello, I have a drop down box mapped to a field in the context, the field has some domain values and are populated in the run time. but I have to add another top row '-Select-' indicating to the client that the field need to be selected. To add 'Sele
-
My wireless hp printer will not communicate with my hp pc
my wireless hp printer will not communicate with my pc
-
How do i clear all the albums in Complete My Album?
I already have downloaded the songs i want and I want to clear off the leftover album icons.
-
Corrupt Attachment after Saving in Chattermail
I have been trying to save Chattermail email attachments to an external card on my Treo 755p and then either move the card to a PC or transmit the attachment via infrared. The process works both ways except for the fact that when I try to open the at
-
23.976 Logic is 1 frame ahead
Dears all i am working on a 23.976 movie. Logic (902 or 911) is one frame ahead. I mean for example : Film is @ 05 04 11 10 and Logic counter is @ 05 04 11 11. I know it's just a frame but just wonder if there is a workaround. Thanks in advance. -A