• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown

I want to develop a spring boot rest app

Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have these files using these I have to develop a spring boot rest app.
How to do that?

I have these dependencies need to put in the pom.xml

and the repositories

         <!-- Define the ID that was added in your Maven's settings.xml -->
         <!---You do not need to change the following lines -->

I have the wurfl-helloworld-spring.jar and zip file which need to be placed in the the resources folder under src
Need to put a web.xml file and we should include these in the web.xml


and The wurfl.ctx context file will contain:

<bean id="WurflHolder" class="com.scientiamobile.wurfl.core.GeneralWURFLEngine">
 <constructor-arg index="0" value="classpath:/wurfl.zip" />
 <!-- <constructor-arg index="1" value="<< patch here >>"/> -->
 <!-- <constructor-arg index="2" value="<< more patches here >>"/> -->

<!-- DeviceCacheProvider -->
<bean id="deviceCacheProvider" class="com.scientiamobile.wurfl.core.cache.LRUMapCacheProvider" />
<!-- <bean id="deviceCacheProvider" class="com.scientiamobile.wurfl.core.cache.DoubleLRUMapCacheProvider" /> -->
<!-- <bean id="deviceCacheProvider" class="com.scientiamobile.wurfl.core.cache.HashMapCacheProvider" /> -->
<!-- <bean id="deviceCacheProvider" class="com.scientiamobile.wurfl.core.cache.NullCacheProvider" /> -->
<!-- <bean id="deviceCacheProvider" class="com.scientiamobile.wurfl.core.cache.EhCacheProvider" /> -->

If you would like to set a capability filter, you will need to add the following properties to your wurfl-ctx.xml:

<property name="capabilityFilter">

Finally, we can simply access the WURFLEngine instance with the code here (taken from a common Servlet method):

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
 WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
 WURFLEngine engine = (WURFLEngine)wac.getBean(WURFLEngine.class.getName());

and the main program looks like this:

import com.scientiamobile.wurfl.core.Device;
import com.scientiamobile.wurfl.core.GeneralWURFLEngine;

public class Wurfl {

   public static void main(String[] args) {
       GeneralWURFLEngine wurfl = new GeneralWURFLEngine("wurfl.xml");
       // load method is available on API version and above

       String user_agent = "Mozilla/5.0 (Linux; Android 4.2.1; N9600 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36";

       Device device = wurfl.getDeviceForRequest(user_agent);
       System.out.println("Is Tablet: " + device.getCapability('is_tablet'));
       System.out.println("Can Assign Phone Number: " + device.getCapability('can_assign_phone_number'));

Please guide me how to develop this as a spring boot rest app.


    Bookmark Topic Watch Topic
  • New Topic