aspose file tools*
The moose likes Spring and the fly likes Spring or EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring or EJB" Watch "Spring or EJB" New topic
Author

Spring or EJB

chandan kumar mitwaa
Ranch Hand

Joined: Jul 01, 2009
Posts: 49
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?


Thanks,
Chandan Kumar
Vivek K Singh
Ranch Hand

Joined: Dec 22, 2009
Posts: 85

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


SCJP 6
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jul 01, 2009
Posts: 49
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

Joined: Sep 29, 2008
Posts: 12617

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 29261
    
140

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
billy chan
Greenhorn

Joined: Feb 07, 2010
Posts: 3
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

Joined: Dec 22, 2009
Posts: 85

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

Joined: Jul 01, 2009
Posts: 49
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

Joined: Feb 09, 2010
Posts: 1
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

Joined: Jul 01, 2009
Posts: 49
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

Joined: Jun 16, 2007
Posts: 686

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


===Vyas Sanzgiri===
My Blog
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
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


Visit my blog: http://jnassef.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring or EJB
 
Similar Threads
SCBCD 5.0 or Spring certification?
Whether Go for SCBCD or not
Spring Live
Too specific job requirements
ejb 3.0 vs spring