java-ee

Connect to hotmail with javamail?

≯℡__Kan透↙ 提交于 2019-12-22 12:24:07
问题 I wonder if it is possible to connect to Hotmail with JavaMail? I've tried this but it doesn't work, connection refused... String host = "pop3.live.com"; String username = "laqetqetqet@hotmail.com"; String password = "rqetqetq"; Session session; Store store; String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; Properties pop3Props = new Properties(); pop3Props.setProperty("mail.pop3.socketFactory.class", SSL_FACTORY); pop3Props.setProperty("mail.pop3.socketFactory.fallback", "false");

which jars are needed for using AspectJ of Spring framework?

烂漫一生 提交于 2019-12-22 12:04:46
问题 import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.ProceedingJoinPoint; @Aspect public class AroundExample { @Around("com.xyz.myapp.SystemArchitecture.businessService()") public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable { // start stopwatch Object retVal = pjp.proceed(); // stop stopwatch return retVal; } } 回答1: You will need current version of aspectj jars i.e. aspectjrt-1.6.6.jar and aspectjweaver-1.7.2.jar

which jars are needed for using AspectJ of Spring framework?

这一生的挚爱 提交于 2019-12-22 11:58:09
问题 import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.ProceedingJoinPoint; @Aspect public class AroundExample { @Around("com.xyz.myapp.SystemArchitecture.businessService()") public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable { // start stopwatch Object retVal = pjp.proceed(); // stop stopwatch return retVal; } } 回答1: You will need current version of aspectj jars i.e. aspectjrt-1.6.6.jar and aspectjweaver-1.7.2.jar

JPQL TREAT AS /LEFT OUTER JOIN

强颜欢笑 提交于 2019-12-22 11:29:29
问题 I'm trying the "TREAT AS" function from JPA 2.1 (eclipselink) and I'm stuck with an error from JPA: Exception Description: ReportQuery result size mismatch. Expecting [263], but retrieved [197] Here is my JPQL query (I change some parts to be more explicit): String jpql = "select distinct s, accountAD " + "from SheetAccountUser s " + "left join fetch s.userTarget target " + "left join TREAT(target.accounts AS ADAccount) accountAD "; ADAccount is a subclass from AbstractAccount (@Inheritance

JPA 2 - Foreign key that only includes one field from a composite primary key?

倖福魔咒の 提交于 2019-12-22 11:13:47
问题 I'm having trouble getting a composite primary key and foreign keys working in JPA 2/Hibernate. I'm trying to create a simple scenario with countries and provinces: Country Entity: @Entity @Table(name = "country") public class Country extends DomainObjectBase implements Serializable { @Id @Basic(optional = false) @Column(name = "code") private String code; @Basic(optional = false) @Column(name = "name") private String name; @OneToMany(cascade = CascadeType.ALL, mappedBy = "country") private

how to get the path of server's folder inside Java program (J2EE + JSTL)

女生的网名这么多〃 提交于 2019-12-22 11:03:57
问题 I wanted to read contents of Excel files in my web-based project (J2EE-JSP+Servlets) which are located inside the web server's folder. I have made a java file, which i will call through a JSP page using JSTL library, but I need to get the path of the Excel sheet in the Java file, so I can read the contents. How can I get the path to the current Java file and so the Excel file? Also, I will be reading the contents of the Excel file through POI library. I was able to do this in J2SE development

how to get the path of server's folder inside Java program (J2EE + JSTL)

♀尐吖头ヾ 提交于 2019-12-22 11:00:02
问题 I wanted to read contents of Excel files in my web-based project (J2EE-JSP+Servlets) which are located inside the web server's folder. I have made a java file, which i will call through a JSP page using JSTL library, but I need to get the path of the Excel sheet in the Java file, so I can read the contents. How can I get the path to the current Java file and so the Excel file? Also, I will be reading the contents of the Excel file through POI library. I was able to do this in J2SE development

Class implementing ServletContainerInitializer in web.xml

对着背影说爱祢 提交于 2019-12-22 10:57:25
问题 Can you point to a class implementing the ServletContainerInitializer interface in the web.xml file or do you have to add a file under the META-INF/services/javax.servlet.ServletContainerInitializer to have a J2EE server pick it up? If it's possible via the web.xml file, please explain how. 回答1: I've checked the Java Servlet Specification 3.0 and I've not found any clue that it could be configured via web.xml . I think the only way is the META-INF/services/javax.servlet

JSF2 and PrettyFaces… how does one get the original URL or the query string?

人盡茶涼 提交于 2019-12-22 10:55:40
问题 PrettyFaces is a dead simple URL rewriting engine. All sorts of SEO is possible and it is really really easy . I have one small problem though :( Using pretty faces, I have this rewrite rule: <url-mapping id="blogEntry"> <pattern value="/blog/#{shortUrl}" /> <view-id value="/blogEntry.jsf" /> </url-mapping> So the URL bar looks like: http://host.com/blog/first-post And the rewrite rule maps the request internally to: http://host.com/blogEntry?shortUrl=first-post I'm implementing OpenID, which

Weblogic wrap application exception in javax.ejb.EJBException

爷,独闯天下 提交于 2019-12-22 10:45:38
问题 My ear application was working fine. But suddenly it started to throw javax.ejb.EJBException in some method calls, instead of returning the original Application Exception (annotated with @ApplicationException(rollback=true). Now the original application exception is wrapped in the EJBException. the Currently the other developer who was working in the project is on leave. Therefore I have no idea what he has done to the code for happening this. This application exception and ejb remote