Mike Blair

Greenhorn
+ Follow
since Sep 10, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Blair

I am doing the tutorial here (http://www.lowagie.com/iText/tutorial/ch07.html) for the Data Merging example. The only difference is in my XML I put the code twice and put it on two pages. This worked fine. Then, I tried adding an image to the top of the two pages. Both images show up on the top of the first page though instead of one image on each page.

Thanks,
Mike
I need to create a "template" in xml that defines what my PDF will look like and dynamically replace a phone number in the pdf. I used the example online, but am having trouble with an image. When I tell the xml to put a new page, it does this for the text but the image prints on the first line right under the first image. Any idea what this isnt working for me?

Thanks!

<letter>
<image <image url="http://localhost/images/homepageImages/myimage.jpg" align="right"/>
To: <mail /><newline />
Ref: your website<newline />
<newline />
Hello <givenname />,<newline />
<newline />
I visited your website a while ago (<website /> and I saw you added
<newpage />

<image url="http://localhost/images/homepageImages/myimage.jpg" align="right"/>
To: <mail /><newline />
Ref: your website<newline />
<newline />
Hello <givenname />,<newline />
<newline />
I visited your website a while ago (<website /> and I saw you added
kind regards,<newline />
Bruno Lowagie
</letter>
"I've done this meantime using Java scriptlets e.g. for(){} loop. Is there any way to do it using struts/jsp tags?"
You would think there was, wouldn't you? I have yet to see it accomplished.
20 years ago
No, do not disregard my message please! I am 100% certain that this is simply handled by the STRUTS framework and it is not needed to jump through hoops to get this accomplished. If anyone could take a look at my iterate and code I posted to see if anything obvious is out of the ordinary it would be greatly appreciated.
Thanks,
Mike
20 years ago
I must be getting close to figuring this out, but I am still lost. Basically I want to be able to get changes made in the table available back in my action class. If anyone has a specific code snippet of the pieces to make this work I would LOVE to see it.
awardMasResultsForm
- form bean with ArrayList awards as a private member.

my .jsp has the following iterate tag

The error I get is : "No getter method for property awards of bean awardMasResultsForm
Any help?
Mike
20 years ago

Originally posted by Martin Riedl:
sometimes it's very useful to read some older posts
the Post 'This has to be easy!' handled a similar problem - i modified my code a bit and now it works - thanks


That is my post, but im still a little fuzzy on this. I have yet to get this to work. Would you be interested in showing me your iterate tag and maybe some snippets of your bean class?
Mike
20 years ago
Thanks! Here is my logic:iterate tag beginning and a few rows within the tag. I will take a look at this link you posted!
<logic:iterate name="awardMasResultsForm" property="awards"
id="AwardMasView">
.
.
<TD VALIGN="MIDDLE" ALIGN="LEFT" class="cell">
<bean:write name="AwardMasView" property="safAwdNameShort"/>
</TD>
<TD VALIGN="MIDDLE" ALIGN="CENTER" class="cell">
<html:checkbox name="AwardMasView" property="deleteRecord"
value="delete" indexed="true"/>
</TD>
20 years ago
Thanks for the quick reply!
I took the lines you gave me and modified them as so to get it to compile clean.
public void setAward(int index, AwardMasView ob){
this.awards.set(index, ob);
}
public AwardMasView getAward(int index){
return (AwardMasView)this.awards.get(index);
}
Now in my action code I get the the list back using this code (which does not work) ... this code produces a NullPointerException
//I want to get the values from the jsp page here
ArrayList awards = ((AwardMasResultsForm)form).getAwards();
Iterator i = awards.iterator(); //
while (i.hasNext()) {
AwardMasView awardmas = (AwardMasView)i.next();
System.out.println(awardmas.getSafAwardCode());
}
20 years ago
Ok, I have a form bean that represents the jsp form. The jsp form has a table that is built using the iterate tag and iterating through an array list of a bean. So far so good, the data displays fine. Now, how do I reverse it? I want to be able to get at this "list" that is present on the jsp page IN my action class. Here is some of the code basics.
If this isnt clear enough, please ask questions and I will try to explain. In a nutshell I want to get the value of a table out of a jsp page and into my action
Mike
public class AwardMasResultsForm extends ActionForm {
// The search field
private ArrayList awards; //this is put into the jsp iterate loop
public void setAwards(ArrayList awdList) {
this.awards = awdList;
}

public ArrayList getAwards() {
return this.awards;
}
public ActionForward filter( ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
AwardSearchService service = new AwardSearchService();
ArrayList awards = service.getAwardMasView( awardCodeView.getAwdCode() );
//I put the list into the form
((AwardMasResultsForm)form).setAwards(awards);
}
now in an effort to get the value back out I have ...
public class CrudAwardsAction extends Action {
public ActionForward execute( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
//I want to get the values from the jsp page here
ArrayList awards = ((AwardMasResultsForm)form).getAwards();
Iterator i = awards.iterator(); //
while (i.hasNext()) {
AwardMasView awardmas = (AwardMasView)i.next();
System.out.println(awardmas.getSafAwardCode());
}
20 years ago
Greetings all,
I have a very simple app that I am playing with. I can't seem to get the deployment descriptors created and placed in the correct places though. If I use the Weblogic Builder to open my ear and have it create them, it deploys fine. However if I manually create the ear using ant I can't get it to deploy.
My error is "Error while loading descriptors: Error processing file 'META-INF/application.xml'"
Is there a directory structure I have to follow? Like, does \META-INF have to be at a specific location? Quick summary of my structure:
app\build\ear\meta-inf = application.xml, weblogic-application.xml
app\build\jar\meta-inf = ejb-jar.xml, weblogic-ejb-jar.xml
app\build\war\web-inf = web.xml, weblogic.xml
Something wrong with this? Any more details I could give you please let me know.
Thanks,
Mike
20 years ago
I am trying to get a simple session bean to access my oracle DB. I can't figure out what all needs to be setup for the JBOSS connection pooling. My java code looks as follows:
DataSource dataSource = (DataSource) (new InitialContext()).lookup( "java:comp/env/jdbc/REGENT" );
Connection con = dataSource.getConnection();
Statement stmt = con.createStatement();
I have this wrapped in a try-catch and the error being returned is "JDBC not bound".
I guess my issue is not knowing what all xml files need setup for jndi to work properly. Here is what I think :
add to web.xml
<resource-ref>
<description>Regent Datasource</description>
<res-ref-name>jdbc/REGENT</res-ref-name>
<res-type> javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
add to ejb-jar.xml
<resource-ref>
<res-ref-name>jdbc/REGENT</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
any thing else?
Thanks!
Mike
Perfect, that took care of it!!
Thanks a ton!
Mike
20 years ago
Ok, this is probably an easy one but i'm struggling with it.
I have my build.xml and when I run ant I get the dreaded "javax.ejb does not exist" error. I realize this means it can't find my j2ee.jar, but i'm not sure how to tell it to find it.
Any help with telling ant where this file is would be greatly appreciated.
Thanks,
Mike
20 years ago
Norman, thank you so much for taking time to help me out!!!
You got my brain going in a different direction and I figured it out. Here is what was happening.
The .jsp was not being included in the .war file as it was not in the correct folder. So the build was making a .war without a jsp and hence the directory structure showing up in my browser.
Again, thanks a ton.
Next beer is on me!!
Mike
20 years ago

Originally posted by norman richards:
That is your build directory and has no relationship to how you deploy the application. When you run the build command, you should have example2.ear being created. Then you copy example2.ear into server/default/deploy.
Is this what you did?



Yep, this is exactly what I do.
20 years ago