• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring or EJB

 
chandan kumar mitwaa
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I want to learn one out of Spring and EJB. I have a little idea about EJB 3.0. I am about to complete my graduation and take a job.
Please suggest me which one should I choose and why?

 
Vivek K Singh
Ranch Hand
Posts: 85
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chandan

Spring is the new "in thing" and for sure it has many many advantages... but EJB is a very widely accepted industry standard, So i would say knowlegde of EJB is a must.

I would say learn both of them atleast on highlevel and then select what you want to dig deep into.

cheers
Vivek
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll give the opposite advice; I've been doing enterprise Java development for almost ten years and have used EJBs exactly once (this might finally change with EJB 3.0). Spring is hardly the "new" thing; it's been around for years, and in my experience is far more prevalent than EJB.
 
chandan kumar mitwaa
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vivek,

Can I manage learning both hand to hand, at same time?? Or I should complete one and go for the other?? How long is it going to take, if I learn them separately?

However I want to add both to my basket, may be in some near future. For the time being I want to have an experience level which helps me deliver considerable output to my company. Please reply in these contexts.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's absolutely no way to tell you how long it's going to take you to "learn" something, there are too many variables to take into account.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
377
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chandan,
Once you know one, the other is going to be much faster to learn. The first will give you concepts such as transactions/security/remoting/etc.

I would say learn Spring first. EJB has been "borrowing" features from Spring so more translates that way.
 
billy chan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my option, Spring should be more useful from my experience, but I didn't said you can give up EJB. Since EJB has a lot of concept to implement Java Enterprise. This concept can let us easier to understand spring or another framework.
Actually, I learned EJB before touch Spring. However, I never implement EJB in my job , but I always use its concept.
 
Vivek K Singh
Ranch Hand
Posts: 85
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For me as well it was same as Billy, Learnt EJB first, implemented 1 solution in it, and havnt used it for last 2.5 yrs (Have been using spring instead) There is certainly a lot of buzz around EJB 3.0, So i would say get an overview of both and then decide for yourself.
 
chandan kumar mitwaa
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read EJB 3.0 only a little, from O' Reilly's Enterprise JavaBeans 3.0, 1.5 years back and I found it quite interesting. I am not sure of Spring. I browse through companies and most of them require Spring. I have seen only a few asking for EJB. Is it that Spring is widely used?

 
saurabh soni
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q1) i m using spring MVC and using mozilla 3.5 to access my page .
i m having a problem that it is returning me null values when filling my jsp page .

my code is.........

my command class is TravelReview.java
code-> public class travelReview{

public String getClientName() {
return clientName;
}
public void setClientName(String clientName) {
this.clientName = clientName;
}
}

name of my command class in controller is
public LiftServiceTravelReviewFormController()
{
setCommandClass(TravelReview.class);
setCommandName("TRAVELFORM");
}

my jsp page is ->

<form method="post" commandName="TRAVELFORM">
<table>
<spring:hasBindErrors name="TRAVELFORM">
<tr>
<td><b>There were following number of errors
${errors.errorCount} </b>
</td>
</tr>
<tr>
<td>
<ul>
<c:forEach var="errorobj" items="${errorlist.allErrors}">
<li><font color="red"><spring:message
code="${errorobj.code}" text="${errorobj}" /></font>
</li>
</c:forEach>
</ul>
</td>
</tr>
</spring:hasBindErrors>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0"
bgcolor="A0A0A0">
<tr>
<td></td>
</tr>
<tr>
<td width="100%" align="center"><font face="bold" size="4"
color="#000000"><b>This feedback is for the agent giving description about the client!!</b></font>
</td>
</tr>
</table>
<table>
<tr>
<td></td>
</tr>
</table>
<table width="50%" border="1" bgcolor="A0A0A0">
<tr>
<td height="70%" align="left"></td>
</tr>
<tr>
<spring:bind path="TRAVELFORM.clientName">
<td align="center"><%=TravelReviewProviderConstant.CLIENT_NAME%></td>
<td align="left">
<input type="text" name="clientName" size="15"
value="${status.value }" width="10"></input>
</td>
<c:if test="${status.error}">
<p>There was an error while entering ClientName</p>
</c:if>
</spring:bind>
</tr>

--------------------------------------------------------------------------------------------------------------


Q2) also im using checkbox in my JSP page and want to return boolean value while submitting form in database but due to mozilla 3.5 it is returning null value so give me some idea to validate checkbox and it is not mandatory that client should click the checkbox while validating .

note that it does not return a null pointer exception in both the cases....



please do reply as soon as possible........
 
chandan kumar mitwaa
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi saurabh soni,

Welcome to JavaRanch!!

You should start a new topic for your query. Please note that your post is not relevant or related to this topic. Also any code must be enclosed between [ code][\ code] so that it will be automatically formatted for better readability.

Also refer to: How To Ask Questions On Java Ranch
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not gone through all the responses since the topics have gone off track. One reason for us to stick with Spring was a biggie - It works on Tomcat
 
Alaa Nassef
Ranch Hand
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll also go for spring. I've been working for 6 years now, almost all projects I've worked on in three companies used spring, and never needed to touch EJB
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic