Nghiem Nguyen

Greenhorn
+ Follow
since Jun 05, 2005
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 Nghiem Nguyen

Hi all,

I want to send an email using java mail that contains <iframe />

I use:
Message msg = new MimeMessage(session);
msg.setSentDate(new Date());
msg.setHeader("X-Mailer", "JavaMailer");
msg.setSubject(MimeUtility.encodeText(subject, "UTF-8", "B"));
msg.setContent(body, "text/html; charset=UTF-8");

and body:
<iframe width='100%' height='100%' scrolling='auto' frameborder='0' src='http://google.com' ></iframe>

but when I receive the email, I always get empty content.

Please help me to find out the problem.

Thanks.
9 years ago
JSP
Take a look at:

java.sun.com/javaee/5/docs/tutorial/doc/JavaEETutorial.pdf
www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss

Good luck!
Nghiem Nguyen
Hi all,

I don't know why but I have some problems with calling getCallerPrincipal() method from a Session Bean. It appears this message 'No valid security context for the caller identity' when I invoke getCallerPrincipal() in a EJB method from my client application.

I send credentials and principals when I create the initial context in client application:

props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:jnp.interfaces");
props.put(Context.PROVIDER_URL,"localhost:1099");
props.put(Context.SECURITY_PRINCIPAL, username);
props.put(Context.SECURITY_CREDENTIALS, password);

I am working on EJB 3.0 and using Application Server JBoss-4.2.1.GA.

Does somebody know why I'm wrong?
Please tell me if I missed somethings!

Thank you very much!
Nghiem Nguyen
Hi all,

I start learning portlet and I want to run some examples to get used to JSR 168 Portlet.

Please tell me how can I config Tomcat to run JSR 168 portlet without any vendors and how can I deploy a JSR 168 portlet on Tomcat server?

I really need your help!
Thanks and regards,
HsRock
[ August 01, 2007: Message edited by: hs rock ]
11 years ago
I solved it by using <bean:write name="..." filter="false"/>

Thank you all,
Nice day!
11 years ago
Hi all,

I use struts 1.1 tag <bean:write ...> to display a html format string like "<br>Hello World", but it cannot recognize <br> html tag, the result is "<br>Hello World". My expected result is "Hello World" with a space line above.
It works well with <%out.write(...)%> in jsp page.
Can anyone help me to find a way to display a string with html format by struts?

Thank alot,
Hsrock
11 years ago
Hi all,
Can you tell me how many servlet instances will be created if there are 20 requests to that servlet?
Thanks for your help.
Rock.
[ July 14, 2006: Message edited by: Bear Bibeault ]
12 years ago
Hi All,
I only know about Web Services concept. So, if I want to create a Java Web Services by hand (not by tool). How many files do I have to write and what are they?
I need your help.
Thanks alot and have a nice day!
Rock.
12 years ago
Hi All,

Can you tell me what this error means:
Exception in thread "main" javax.ejb.EJBException: org.hibernate.PersistentObjectException: detached entity passed to persist: account.entity.TransferAccount
and I đon't understand exactly about attached, detached ans reattached mechanism.
Please help me!
Thanks a lot.
Rock
Hi All,
I couldn't remove the entity instance in the child entity if the father entity had "fetch = FetchType.EAGER" before the Collection of child.

In father Entity:
@Entity
@Table(name = "Phuong")
public class Phuong implements java.io.Serializable {
private String maphuong;
private String tenphuong;
private Collection<Khom> khoms;

@Id
public String getMaphuong() {
return maphuong;
}

public void setMaphuong(String maphuong) {
this.maphuong = maphuong;
}

public String getTenphuong() {
return tenphuong;
}

public void setTenphuong(String tenphuong) {
this.tenphuong = tenphuong;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY,
mappedBy="phuong")
public Collection<Khom> getKhoms() {
return khoms;
}

public void setKhoms(Collection<Khom> khoms) {
this.khoms = khoms;
}


In child Entity:
@Entity
@Table(name = "Khom")
public class Khom implements java.io.Serializable {
private String makhom;
private String tenkhom;
private Phuong phuong;

@Id
public String getMakhom() {
return makhom;
}

public void setMakhom(String makhom) {
this.makhom = makhom;
}

public String getTenkhom() {
return tenkhom;
}

public void setTenkhom(String tenkhom) {
this.tenkhom = tenkhom;
}

@ManyToOne
@JoinColumn(name = "maphuong")
public Phuong getPhuong() {
return phuong;
}

public void setPhuong(Phuong phuong) {
this.phuong = phuong;
}
}

and In session Bean:
public void deleteKhom(String makhom){
khom = manager.find(Khom.class, makhom);
if(khom != null){
manager.remove(khom);
System.out.println("Removed Khom!");
}
else{
System.out.println("Cannot find!");
}
}

Please Help me.
Thanks and sorry for my poor English.
Rock.
Hi All,
Can anyone tell me about what is Dependency Injection in EJB 3.0?
Thanks a lot.
Rock.
Hi All,
I cannot see the descriptions of CMP & BMP in EJB 3.0.
I only see Entity Bean.
Did CMP & BMP disappear in EJB 3.0.
Please answer me.
Thanks
Rock.
Hi All,
I want to display Vietnamese in Combo box by using Option Object in javascript, but I can't.
I had some errors with font.
Please help me.
Sorry for my poor English.
Rock.
Hi All,

I am working on Struts and JBoss portal and I have some problems.
I can display Vietnamese by Struts but when I use Struts in Portlet, Its font become strange ----> like '?'. In Struts, I use filter to display Vietnamese (utf-8), so how can I display Vietnamese in Portlet.
Please give me a solution.

Sorry for my poor English.
Rock.
13 years ago
Thank you Ulf Dittmer,

I will begin with SOAP and WSDL standards, and if I have any problems, please help me later.

Have a nice day.
Rock.
13 years ago