how to use getdatasource(request) method - struts

new to struts i try to get database connection using datasource. any one tell me how to use getdatasource(request) method in struts...give me some example
Thanks in Advance
Regards
Mouli V

Here are some examples from the net
http://www.javabeat.net/articles/24-introduction-to-struts-actions-3.html
http://www.jaxmag.com/itr/online_artikel/psecom,id,616,nodeid,147.html
http://struts.apache.org/1.1/faqs/database.html

Related

How to pass dynamic values to a GET API request?

The following GET request passes
#GET("api/v1/shades/colors?color=bl")
Call<List<Colors>> getColors();
but the following GET request fails.
#GET("api/v1/shades/colors?color={colorId}")
Call<List<Colors>> getColors(#Path(StringConstants.COLOR_ID) String colorId);
What's the right way to pass a dynamic value to a GET request?
Thank you!
It seems like you are using JaxRS web application. You should use this :
#GET("api/v1/shades/colors")
Call<List<Colors>> getColors(#Query("color") String colorId);
Check this: https://docs.oracle.com/javaee/6/tutorial/doc/gilik.html and this: https://mkyong.com/webservices/jax-rs/jax-rs-queryparam-example/.
Hope it helps !
Use annotation #RequestParam:
#GET("api/v1/shades/colors")
Call<List<Colors>> getColors(#RequestParam String colorId);

How to access values from the context:property-placeholder in MEL?

can someone pls advise how to access values from a context:property-placeholder in MEL?
I've found an article that describes how to access the values from Java here.
Need similar for MEL.
Thanks,
It is simple mostly same as in Spring container of java. You access it using ${key} where key is present in your properties file.
OK, I had to find the answer by myself.
The syntax of accessing a property value in MEL depends on a type of the value.
For String values it should be like this:
MyStringVar='${MyProperty}';
while for numeric values the quotas not required.
you can try with ${propertyName}, where ever you want to access properties.
You should be able to access the property value as shown below:
<set-variable variableName="someName" value="${xyz.someProperty}" />

How to create a view from Bigquery REST api

Is it possible to create a view in Bigquery from REST api.
Please let me know if possible.
please share some sample code.
thanks,
Chandan Reddy
You can create a view by calling tables.insert with a table resource containing a "view" property.
https://developers.google.com/bigquery/docs/reference/v2/tables#resource
The following code works .. !!
Table content= new Table();
TableReference tableReference= new TableReference();
tableReference.setTableId("ViewName");
tableReference.setDatasetId("DataSetName");
tableReference.setProjectId(getProjectId());
content.setTableReference(tableReference);
ViewDefinition view= new ViewDefinition();
view.setQuery("SELECT * FROM [DataSetName.TableName]");
content.setView(view);
System.out.println(content);
bigquery.tables().insert(getProjectId(), "DataSetName", content).execute();
As per the documentation, that's not possible at the moment.
https://developers.google.com/bigquery/querying-data#views
The supported ways of creating a view are the command line tool and the web interface. You can programatically invoke the command line tool and then use the table "patch" method via REST to update the query used for the view if necessary.

How can I apply DragFlickBehavior in code?

How can I apply the win8nl DragFlickBehavior for a grid in code behind?
Any help will really appreciated.
Thanks in advance
I got the solution
Win8nl.Behaviors.DragFlickBehavior behaviour = new DragFlickBehavior();
WinRtBehaviors.Interaction.GetBehaviors(grdNew).Add(behaviour);
Behaviours are currently not supported on Win8Dev. Have a look at
http://winrtbehaviors.codeplex.com/
This post by the author shows how to use implement it
http://dotnetbyexample.blogspot.co.uk/2012/03/attached-behaviors-for-windows-8-metro.html

CAML query generator/builder

i am looking for sharepoint caml query builder function which could take input as field/value/operator/condition and return caml query string with both combinations (AND/OR)
check out these tools
http://www.codeproject.com/Articles/458008/CAML-Query-Builder
http://spcamlviewer.codeplex.com/
http://spcamlqueryhelper.codeplex.com/
hope it helps :) .
The U2U tool link seems to be broken now:
I've found this instead:
About: http://www.sjoukjezaal.com/blog/tool-sharepoint-developers-caml-designer/
Download:
http://sharepoint.biwug.be/SitePages/Caml_Designer.aspx
For C#, check out Camlex.NET: http://camlex.codeplex.com/