this is only possible if the java files/libraries that are in the client
package can be translated/compiled to Javascript (or you provide an
override via super-source).
Spring beans/service most definatley can't be translated to javascript



On Mon, Apr 15, 2013 at 5:13 AM, Senyuan Wang <[email protected]>wrote:

> I guess you put this service under the client package, which will be
> compiled into Javascript.
>
> On Friday, April 12, 2013 11:39:49 PM UTC+8, vinu raju wrote:
>>
>>
>> can anybody help me , how to send the mail using gwt and spring.
>>
>> i tried but getting error as : no source code is available for type
>> org.springframework.core.io.**Resource,did you forget the inherit a
>> required module?
>>
>> my code is this:
>>
>> *Client side:*
>> Resource res = new ClassPathResource("classpath:**
>> context/applicationContext.**xml");
>>         BeanFactory factory = new XmlBeanFactory(res);
>>
>>         Object o = factory.getBean("id2");
>>         GreetingServiceImpl mail = (GreetingServiceImpl)o;
>>         //String password =result.getPassword();
>>
>>         try {
>> mail.sendMail("fromvinu1","**fromvinu1","forgotpassword",**password);
>>  } catch (Exception e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>>  }
>>
>> *Server side*:
>>
>> private MailSender mail;
>>  public void setMail(MailSender mail)
>>      {
>>          this.mail = mail;
>>      }
>> public String sendMail(String from, String to,String subject,String msg) {
>>  SimpleMailMessage message = new SimpleMailMessage();
>>
>>     message.setFrom(from);
>>     message.setTo(to);
>>     message.setSubject(subject);
>>     message.setText(msg);
>>
>>     mail.send(message);
>>     System.out.println("Mail Sent Successfully...!");
>>    // return UserInfo;
>> return msg;
>>
>> *XML file:*
>> <bean id="id1" class="org.springframework.**mail.javamail.**
>> JavaMailSenderImpl">
>>      <property name="host" value="smtp.gmail.com" />
>>      <property name="port" value="465" />
>>      <property name="username" value="fromvinu1" />
>>      <property name="password" value="********" />
>>
>>      <property name="javaMailProperties">
>>        <props>
>>          <prop key="mail.smtp.auth">true</**prop>
>>          <prop key="mail.smtp.socketFactory.**class">javax.net.ssl.**
>> SSLSocketFactory</prop>
>>          <prop key="mail.smtp.socketFactory.**port">465</prop>
>>          <prop key="mail.debug">true</prop>
>>          <prop key="mail.smtp.starttls.**enable">true</prop>
>>        </props>
>>      </property>
>> </bean>
>>
>> <bean id="id2" class="package.**GreetingServiceImpl">
>> <property name="mail" ref="id1" />
>> </bean>
>> *
>> *
>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Web Toolkit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/5Ox4kxeI1wc/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to