Search Results

Search found 2126 results on 86 pages for 'jsp fragments'.

Page 33/86 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • How to add next and previous buttons to my pager row

    - by eddy
    Hi folks!! How would I add next/previous buttons to this snippet, cause as you can see ,it will display as many links as it needs, so if you have a high number of pages then this might not be the best solution <c:choose> <c:when test="${pages >1}"> <div class="pagination art-hiddenfield" > <c:forEach var="i" begin="1"end="${pages}" step="1"> <c:url value="MaintenanceListVehicles.htm" var="url"> <c:param name="current" value="${i}"/> </c:url> <c:if test="${i==current}"> <a href="<c:out value="${url}"/> " class="current" > <c:out value="${i}" /></a> </c:if> <c:if test="${i!=current}"> <a href="<c:out value="${url}"/> " > <c:out value="${i}" /></a> </c:if> </c:forEach> </div> </c:when> <c:otherwise> <div align="center"> </div> </c:otherwise> </c:choose> CSS: .pagination .current { background: #26B; border: 1px solid #226EAD; color: white; } .pagination a { display: block; border: 1px solid #226EAD; color: #15B; text-decoration: none; float: left; margin-bottom: 5px; margin-right: 5px; padding: 0.3em 0.5em; } .pagination { font-size: 80%; float: right; } div { display: block; } This is what I get with my current code: And this is what I'd like to display, with ellipsis if possible Hope you can help me out.

    Read the article

  • Java Servlet connecting to SQL Server tutorial?

    - by phill
    Can anyone recommend a tutorial on how to write a Java Servlet which connects to MS SQL server and manages data? I'm trying to write something which pulls products out of one database and inserts them into a stored procedure located on another database. Thanks in advance.

    Read the article

  • On screen orientation loads again data with Async Task

    - by Zookey
    I make Android application with master/detail pattern. So I have ListActivity class which is FragmentActivity and ListFragment class which is Fragment It all works perfect, but when I change screen orientation it calls again AsyncTask and reload all data. Here is the code for ListActivity class where I handle all logic: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); getActionBar().setTitle("Dnevni horoskop"); if(findViewById(R.id.details_container) != null){ //Tablet mTwoPane = true; //Fragment stuff FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); DetailsFragment df = new DetailsFragment(); ft.add(R.id.details_container, df); ft.commit(); } pb = (ProgressBar) findViewById(R.id.pb_list); tvNoConnection = (TextView) findViewById(R.id.tv_no_internet); ivNoConnection = (ImageView) findViewById(R.id.iv_no_connection); list = (GridView) findViewById(R.id.gv_list); if(mTwoPane == true){ list.setNumColumns(1); //list.setPadding(16,16,16,16); } adapter = new CustomListAdapter(); list.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { pos = position; if(mTwoPane == false){ Bundle bundle = new Bundle(); bundle.putSerializable("zodiac", zodiacFeed); Intent i = new Intent(getApplicationContext(), DetailsActivity.class); i.putExtra("position", position); i.putExtras(bundle); startActivity(i); overridePendingTransition(R.anim.right_in, R.anim.right_out); } else if(mTwoPane == true){ DetailsFragment fragment = (DetailsFragment) getSupportFragmentManager().findFragmentById(R.id.details_container); fragment.setHoroscopeText(zodiacFeed.getItem(position).getText()); fragment.setLargeImage(zodiacFeed.getItem(position).getLargeImage()); fragment.setSign("Dnevni horoskop - "+zodiacFeed.getItem(position).getName()); fragment.setSignDuration(zodiacFeed.getItem(position).getDuration()); // inflate menu from xml /*if(menu != null){ MenuItem item = menu.findItem(R.id.share); Toast.makeText(getApplicationContext(), item.getTitle().toString(), Toast.LENGTH_SHORT).show(); }*/ } } }); if(!Utils.isConnected(getApplicationContext())){ pb.setVisibility(View.GONE); tvNoConnection.setVisibility(View.VISIBLE); ivNoConnection.setVisibility(View.VISIBLE); } //Calling AsyncTask to load data Log.d("TAG", "loading"); HoroscopeAsyncTask task = new HoroscopeAsyncTask(pb); task.execute(); } @Override public void onConfigurationChanged(Configuration newConfig) { // TODO Auto-generated method stub super.onConfigurationChanged(newConfig); } class CustomListAdapter extends BaseAdapter { private LayoutInflater layoutInflater; public CustomListAdapter() { layoutInflater = (LayoutInflater) getBaseContext().getSystemService( Context.LAYOUT_INFLATER_SERVICE); } public int getCount() { // TODO Auto-generated method stub // Set the total list item count return names.length; } public Object getItem(int arg0) { // TODO Auto-generated method stub return null; } public long getItemId(int arg0) { // TODO Auto-generated method stub return 0; } public View getView(int position, View convertView, ViewGroup parent) { // Inflate the item layout and set the views View listItem = convertView; int pos = position; zodiacItem = zodiacList.get(pos); if (listItem == null && mTwoPane == false) { listItem = layoutInflater.inflate(R.layout.list_item, null); } else if(mTwoPane == true){ listItem = layoutInflater.inflate(R.layout.tablet_list_item, null); } // Initialize the views in the layout ImageView iv = (ImageView) listItem.findViewById(R.id.iv_horoscope); iv.setScaleType(ScaleType.CENTER_CROP); TextView tvName = (TextView) listItem.findViewById(R.id.tv_zodiac_name); TextView tvDuration = (TextView) listItem.findViewById(R.id.tv_duration); iv.setImageResource(zodiacItem.getImage()); tvName.setText(zodiacItem.getName()); tvDuration.setText(zodiacItem.getDuration()); Animation animation = AnimationUtils.loadAnimation(getBaseContext(), R.anim.push_up); listItem.startAnimation(animation); animation = null; return listItem; } } private void getHoroscope() { String urlString = "http://balkanandroid.com/download/horoskop/examples/dnevnihoroskop.php"; try { HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(urlString); HttpResponse response = client.execute(post); resEntity = response.getEntity(); response_str = EntityUtils.toString(resEntity); if (resEntity != null) { Log.i("RESPONSE", response_str); runOnUiThread(new Runnable() { public void run() { try { Log.d("TAG", "Response from server : n " + response_str); } catch (Exception e) { e.printStackTrace(); } } }); } } catch (Exception ex) { Log.e("TAG", "error: " + ex.getMessage(), ex); } } private class HoroscopeAsyncTask extends AsyncTask<String, Void, Void> { public HoroscopeAsyncTask(ProgressBar pb1){ pb = pb1; } @Override protected void onPreExecute() { pb.setVisibility(View.VISIBLE); super.onPreExecute(); } @Override protected Void doInBackground(String... params) { getHoroscope(); try { Log.d("TAG", "test u try"); JSONObject jsonObject = new JSONObject(response_str); JSONArray jsonArray = jsonObject.getJSONArray("horoscope"); for(int i=0;i<jsonArray.length();i++){ Log.d("TAG", "test u for"); JSONObject horoscopeObj = jsonArray.getJSONObject(i); String horoscopeSign = horoscopeObj.getString("name_sign"); String horoscopeText = horoscopeObj.getString("txt_hrs"); zodiacItem = new ZodiacItem(horoscopeSign, horoscopeText, duration[i], images[i], largeImages[i]); zodiacList.add(zodiacItem); zodiacFeed.addItem(zodiacItem); //Treba u POJO klasu ubaciti sve. Log.d("TAG", "ZNAK: "+zodiacItem.getName()+" HOROSKOP: "+zodiacItem.getText()); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); Log.e("TAG", "error: " + e.getMessage(), e); } return null; } @Override protected void onPostExecute(Void result) { pb.setVisibility(View.GONE); list.setAdapter(adapter); adapter.notifyDataSetChanged(); super.onPostExecute(result); } } Here is the code for ListFragment class: public class ListFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub // Retain this fragment across configuration changes. setRetainInstance(true); super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View view = inflater.inflate(R.layout.fragment_list, container, false); return view; } }

    Read the article

  • Compare Long values Struts2

    - by Marquinio
    Hi everyone I'm trying to compare two values using struts2 s:if tag but its not working. If I hardcode the values it works but I want it to be dynamic. The variable stringValue is of type String. The variable currentLongValue is of type Long. <s:set var="stringValue" value="order"/> <s:iterator value="listTest"> <s:set var="currentLongValue" value="value"/> <s:if test="#currentLongValue.toString() == #stringValue" > //Do something </s:if> <s:else> //Do something else </s:else> </s:iterator> For the s:if I have tried toString and also the equals(). It only works if I hardcode the values. Example: <s:if test="#currentLongValue == 1234"> Any clues? Thank you.

    Read the article

  • Using <input type=file /> with J2EE/MySQL Backend

    - by Mark Hazlett
    Hey everyone, I'm wondering how I can hook up an input type=file to send a picture back to a backend servlet that will eventually be stored in a MySQL database as a BLOB? In other words, how can I upload a picture using the input and send that back to the servlet to insert into the database as a BLOB type? Thanks

    Read the article

  • getView() in CountDownTimer's onTick return sometimes null

    - by HexWrench
    I had recently a crash report where I could see that in the CountDownTimer's onTick method the getView() call returns null. I use the onTick method to display the remaining time in a textView. The textView is inside a Fragment. Since the CountDownTimer runs in the UI thread I have no idea why this had happened. What could be the cause for this and what is a possible workaround for this problem? Thanks!

    Read the article

  • Change div backgroung color base on result from servlet using jquery

    - by Both FM
    Java Script Code Snippet $(document).ready(function() { $("#button").click(function(){ $cityName = document.getElementById("name").value; $.post("AddServlet", { name:$cityName }, function(xml) { $("#feedback").html( $("result", xml).text() ); }); }); }); In Servlet String name= request.getParameter("name"); if (name.equals("shahid")) { response.setContentType("text/xml"); out.println("<result>You are shahid</result>"); } else{ response.setContentType("text/xml"); out.println("<result>You are not shahid</result>"); } This is working fine! but I want to change the background color of div (feedback) accordingly , means if condition true, background color should be Green otherwise background color should be Red (else)

    Read the article

  • NoClassDefFoundError when trying to reference external jar files

    - by opike
    I have some 3rd party jar files that I want to reference in my tomcat web application. I added this line to catalina.properties: shared.loader=/home/ollie/dev/java/googleapi_samples/gdata/java/lib/*.jar but I'm still getting this error: org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/google/gdata/util/ServiceException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) I verified that the com.google.gdata.util.ServiceException is in the gdata-core-1.0.jar file which is in the directory: /home/ollie/dev/java/googleapi_samples/gdata/java/lib I did bounce tomcat after I modified catalina.properties. Update 1: I tried copying the gdata-core-1.0.jar file into /var/lib/tomcat6/webapp/examples/WEB-INF/lib as a test but that didn't fix the problem either. Update 2: It actually does work when I copy the jar file directly into the WEB-INF/lib directory. There was a permissions issue that I had to resolve. But it's still not working when I use the shared.loader setting. I reconfirmed that the path is correct.

    Read the article

  • This code is not submitting to a form? Why

    - by Ankur
    Since I am using get I expect to see the submitted values appended to the queryString but instead all I see is the URL of the servlet being called with nothing added at the end. <form id="editClassList" name="editClassList" method="get" action="EditClassList"> <% HashMap<Integer,String> classes = new HashMap<Integer,String>(); classes = (HashMap<Integer,String>) request.getAttribute("classes"); %> <% if(classes.size()==0){ %> <label><input class="small-link" type="text" id="add-this-class" size="42" value="" /></label> <% } %> <% Set<Integer> classIds = new HashSet<Integer>(); classIds = classes.keySet(); Iterator<Integer> itr = classIds.iterator(); while(itr.hasNext()){ int nextId = (Integer)itr.next(); %> <label><input class="small-link" type="text" id="<% out.print(nextId); %>" size="42" value="<% out.print(classes.get(nextId)); %>" /> </label> <img id="add-class" src="images/add.png" width="16" height="16" /><br /> <label><input class="small-link" type="text" id="class-to-add" size="42" value="" /></label> <% } %> <label><input type="submit" id="save-class-btn" value="Save Class(es)" /></label> </form>

    Read the article

  • How to enable reading non-ascii characters in Servlets

    - by Daziplqa
    How to make the servlet accept non-ascii (Arabian, chines, etc) characters passed from JSPs? I've tried to add the following to top of JSPs: <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> And to add the following in each post/get method in the servlet: request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); I've tried to add a Filter that executes the above two statements instead of in the servlet. To be quite honest, these was working in the past, but now it doesn't work anymore. I am using tomcat 5.0.28/6.x.x on JDK1.6 on both Win & Linux boxes.

    Read the article

  • jQuery + Dialog Form Validation

    - by Panther24
    Hi, I have a jQuery Dialog form and on submit I'm trying to validate the fields. I'm using http://docs.jquery.com/Plugins/Validation to validate. In this I'm facing an issue, the validate function is not being called. I'm posting some snippet of my code $("#register-dialog-form").dialog({ autoOpen: false, height: 350, width: 450, modal: true, buttons: { 'Register': function() { $("#registerFrm").validate({ rules: { accountid: "required", name: { required: true, minlength: 5 }, username: { required: true, minlength: 5 }, password: { required: true, minlength: 5 } }, messages: { firstname: "Please enter your firstname", accountid: "Please enter the lastname", name: "Please enter a user friendly name", username: { required: "Please enter a username", minlength: jQuery.format("Enter at least {0} characters") }, password: { required: "Please provide a password", minlength: jQuery.format("Password must be at least {0} characters long") } } }); //****************** //TODO: Need to submit my form here //****************** $(this).dialog('close'); }, Cancel: function() { $(this).dialog('close'); } }, close: function() { //$('registerFrm').clearForm(); } }); Can someone please tell me what I'm doing wrong here. I've also tried to put the validation into $(document).ready(function() {}, but with no success. Here is the html code <div id="register-dialog-form" title="Register Account - Master" align="center" style="display: none"> <s:form name="registerFrm" id="registerFrm" action="registermaster" method="POST"> <table width="90%" border="0" class="ui-widget"> <tr> <td> <s:textfield label="Account Id" name="accountid" id="accountid" cssClass="text ui-widget-content ui-corner-all" /> </td> </tr> <tr> <td> <s:textfield label="Name" name="name" id="name" cssClass="text ui-widget-content ui-corner-all" /> </td> </tr> <tr> <td> <s:textfield label="Username" name="username" id="username" cssClass="text ui-widget-content ui-corner-all" /> </td> </tr> <tr> <td> <s:password label="Password" name="password" id="password" cssClass="text ui-widget-content ui-corner-all" /> </td> </tr> </table> </s:form> </div><!--End of RegisterAcc form-->

    Read the article

  • Implementing logout function

    - by Nitish Kumar
    Hi, I am working on my final year project which is an web based application. I want to implement logout function in that project. But don't know how to do that. Also I want to implement auto logout functionality i.e. after a particular time period say after 20 minutes a user will be automatically logged out if he/she does not perform any action during this period. A message should be displayed to the user "Sorry, Your session has expired Please login again". How to do that?

    Read the article

  • any way to use ajax with jstl customtags without duplicating tags in javascript?

    - by CodeMonkeyB
    I am working on a page where part of the content is loaded normally and the pages are rendered using jsps. The product images and links generated on that page are by custom jstl tags. When the user scrolls more products are requested from the server in a JSON response and then using UnderscoreJS templates they are rendered and added to the bottom of the page. Is there any way I can use the JSTL tags in Javascript without recreating them using a javascript function (it won't be possible to re-create all of them in javascript). What is the best way to handle this scenario? I guess I could return a rendered html response for the ajax call, but that would mean I have some ajax requests which use json and some that use rendered html...

    Read the article

  • How to create a proxy server?

    - by Rakesh Juyal
    I want to create a proxy server. I googled it and even found some tutorial but those were in PHP. If somebody is having tutorial of proxy server creation in java then please post it here Or simply let me know what approach should i follow to create a proxy server. [ i will be using Tomcat { if that matters for your answer } ] Thanks

    Read the article

  • How to create a web proxy?

    - by Rakesh Juyal
    I want to create web proxy . I googled it and even found some tutorial but those were in PHP. If somebody is having tutorial of web proxy creation in java then please post it here Or simply let me know what approach should i follow to create web proxy. [ i will be using Tomcat { if that matters for your answer } ] Thanks Edit i guess i was not clear in stating what i require. Actually i am trying to develop a site like 'http://proxyug.com/' .

    Read the article

  • How to reference an object in a lower fragment in android

    - by Silas Greenback
    I am trying to build a help screen that is going to go on a mediaplayer. The idea is to put a fragment with a transparent theme on top of the current view. (See How do I create a help overlay like you see in a few Android apps and ICS? for the basic idea). Now, I understand the steps in the mentioned link, but how do I connect the circles and arrows and paragraphs next to each one (explaining what each one was) to the lower object? Example, I have an object: R.id.music_button and I want there to be and arrow that points to music button. Trying to support as many devices as we do it will be very difficult to just draw a few pictures as part of the top layout and expect them to line up. Again, how do I reference an object on a fragment below the top level? Thanks

    Read the article

  • select multiple double side

    - by Mercer
    hello, i want to do a select multiple double side like this : http://www.senamion.com/blog/jmultiselect2side.html (Demo2) but i don't know how i can retrieve my data when i click submit button..?

    Read the article

  • Triggering Quartz job from JSF (Any front end)- How to wait for the job execution to be over

    - by Maximus
    I am developing a front end to trigger a quartz job on the fly. I have a form in the JSF page whose click action will dynamically trigger a quartz job. The job is invoked by the following statement, the job is triggered and everything works fine. scheduler.triggerJob("Job1",Scheduler.DEFAULT_GROUP,jobDataMap); From what I understand the job seems to run in a separate thread and the execution of the calling function does not wait for the job to be over. Since I am invoking the job from front end, I would like to wait till the job is over before I navigate to a different JSF page. So I can display an error message if the job fails. I would also like to display a message to the user, "Processing job, please wait.." until the job is actually over. Any ideas on how to accomplish this will be appreciated. Thanks !

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >