java


I want to write web service in java which will fetch the mail from my mailbox with my credentials [on hold]


I am new to web services want to learn more here I wanted to write the web services which will help me to fetch the emails from my inbox. so want to ask which type of web service should I write or from where should I start. Actually, before this, I created the web services which fetches and stores the data into the database.
following code is which I use for fetching data from the database.
#POST
#Path("signup")
#Consumes(MediaType.APPLICATION_FORM_URLENCODED)
#Produces(MediaType.TEXT_HTML)
public Viewable signup(#FormParam("userName") String userName,
#FormParam("password") String password,
#FormParam("firstName") String firstName,
#FormParam("lastName") String lastName,
#FormParam("dateOfBirth") String dateOfBirth,
#FormParam("emailAddress") String emailAddress) throws
ParseException {
Student student = new Student();
student.setUserName(userName);
student.setPassword(password);
student.setFirstName(firstName);
student.setLastName(lastName);
student.setDateOfBirth(new java.sql.Date(new
SimpleDateFormat("MM/dd/yyyy")
.parse(dateOfBirth.substring(0, 10)).getTime()));
student.setEmailAddress(emailAddress);
if(studentService.findByUserName(userName)) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("message", "User Name exists. Try another user name");
map.put("student", student);
return new Viewable("/signup", map);
} else {
studentService.save(student);
return new Viewable("/login");
}
}
Service for saving details
#Transactional
public <S extends T> S save(S entity) {
if (this.entityInformation.isNew(entity)) {
this.em.persist(entity);
return entity;
} else {
return this.em.merge(entity);
}
}


Related Links

How to get lazy collection with Spring jpa repository?
How to switch off hibernate log DEBUG level?
I have String of object I want to put this string in hash map in java
HashSet not removing all duplicate entries
Server(C) on the PI doesn't make connection with Client(Java)
Scanner.nextInt() throwing InputMismatchException when reading an integer
How to list third party libraries in netbeans platform
For loop to print consecutive numbers?
Jvisualvm shows cpu usage more than the number of processors
Error while attempting to reverse the digits of an integer
The server refused this request because the Request entity is in a format not supported by the requested for the requested method() -_
How to check whether a date comes before or after
Trouble creating a program using multiple classes in Java
Why does my REST API return blank JSON on nested objects?
Multiple connections database oracle Wildfly
how to set position for button in cardview

Categories

HOME
twitter
netbeans
zeromq
magnific-popup
server
mediawiki
reserved
office365api
react-redux
c#-2.0
windows-server
ojdbc
acquia
azure-storage-tables
bs4
adfs
basic
medical
adobe-analytics
izpack
offline
collectd
decimal
clearcase-ucm
windows-7-x64
ef-migrations
reactive-cocoa
normalizr
interop
google-cloud-speech
jtextfield
arabic
web-sql
tapestry
claims-based-identity
blazemeter
crosstab
emgucv
buildbot
react-css-modules
fopen
fluentvalidation
quote
tinymce-4
galsim
google-cloud-endpoints-v2
uisplitview
pdb
android-kernel
mapbox-gl
git-merge
xcode-extension
jna
texmaker
powershell-dsc
keydown
s
segment
qwt
osx-mavericks
pubmed
paxos
colorama
android-cursor
zendesk-app
linode
lync-client-sdk
django-scheduler
query-performance
static-ip-address
instant
bgp
dlna
hexdump
suffix-tree
xpath-1.0
icu4j
cannon.js
wireshark-dissector
security-testing
sframe
deis
ios9.1
c++03
python-green
onactivityresult
braille
algebraic-data-types
mbr
ccss
quartz-graphics
batterylevel
drools-planner
libstdc++
dbproviderfactories
ticoredatasync
bubble-chart
spring-portlet-mvc
punbb
mod-auth
tomcat-valve
html-input
filtered-index
routedevent
javap
virtual-functions
simpletest





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm