8 Replies Latest reply on May 1, 2010 8:11 AM by charlie@carehart.org

    Simple HTML Preview


      I am moving to ColdFusion Builder from Dreamweaver and I am having issues with my html preview. I am trying to set up a project and give it the host header/url to use for html preview, but it keeps telling me that I don't have the ColdFusion server defined for my project. I don't really want to go through all that. I just want to tell it what host header to use. Any thoughts? Am I thinking about this wrong?


      I have a project, without CFnature, whatever that is, and under properties->HTML Preview I am telling it to use an absolute URL and append the project relative path. When I try to use the browser preview, I get 'No server is configured. . . Configure a server.'


      Any insight would be helpful.


      PS - I tried searching for an answer for this, but didn't have any luck. If anyone has any tips on that I am open.

        • 1. Re: Simple HTML Preview
          Adam Cameron. Level 5

          Well if you want to use the browser preview, you need to set up a server.  That's the long and the short of it: that's the way CFB works.


          However this does prompt the question as to why CFB needs a server configured to browse a web page, provided you have told the project what its root maps to, domain/URL-wise.


          Can we get an explanation from one of the Adobe bods, pls?






          • 2. Re: Simple HTML Preview
            robliesland Level 1

            Thanks, Adam. That's not the answer I was hoping for, but I figured that might be the answer. I feel like I just need to change the way I think about things.

            • 3. Re: Simple HTML Preview
              Adam Cameron. Level 5

              Yep.  It takes a coupla min to set up a server, and you only need to do it once.  So it's not exactly a hardship.


              Or, like, don't bother with the embedded browser at all and just use the browser on your desktop.  I have to say I have never really understood why people test their HTML in a browser embedded in their "IDE" (or why an IDE even offers such a "feature") when they've almost always going to have a browser installed on the PC.



              • 4. Re: Simple HTML Preview
                robliesland Level 1

                For me it is just a matter of laziness. I like to open my file, edit it, and then be able to easily preview the changes at the press of a button, rather than having to enter the correct URL.

                • 5. Re: Simple HTML Preview
                  charlie@carehart.org Adobe Community Professional & MVP

                  They have indeed provided for this: right-click on a project and use "Set URL Prefix". It's specifically for those who don’t' want to setup a server for their project.



                  • 6. Re: Simple HTML Preview
                    charlie@carehart.org Adobe Community Professional & MVP

                    Adam notes the ease of setting up the Server configuration for a project. I would like to share some thoughts on why people may not do it, or why they should be prepared for possible problems if they do.  (And why the previous "set url prefix" may be the preferred option for someone like robliesland who wanted that alone.)


                    It's true that adding a server connection is relatively simple to do (though not always), and it does to make CFB sing and dance, like showing datasources when you do CFQUERY NAME=", or when invoking methods of a CFC, and all the other cool things, but to get that you must configure the server connection which does change CFB to do potentially a LOT more work in the background (and at startup, and when opening projects, etc.) so that it gathers all the that cool info.


                    Some have complained of CFB being slow, and often it's because of this very connection to a server, at least in some situations (with a remote server, or one whose files are remote to you on your network, or where the CF server has a huge repository of CFCs pointed to by all its mappings, custom tag paths, a large webroot, etc.)


                    When you connect it to a server, you're asking it to provide all the powerful features that make it more than "just an editor" (or "just a knock off of CFEclipse"). But those extra (and powerful and vital) features do come at a cost, which some pay more than others, and is why some have chosen not to create server connections from their projects.


                    Of course, others don't do it because they either just don't notice they can, or choose not to when crating a project because they don't understand what it would give them (then they complain that it's nothing more than a CFEclipse knock off, and round and round we go.) It can also be a challenge to setup the server connection in some instances, like if the CF server is remote to you, etc.


                    I will note that as far as understanding the performance impact I allude to above, it can be REALLY helpful to turn on the Progress View (View>Show Other>Progress). At least you can see what's happening, and you may be very surprised. (It also tracks other background operations, like FTP processing if you do that.)


                    And you can also configure CFB to NOT do a refresh of the info from the "server" in several situations, such as when CFB either starts, or when you open a project, etc. See Preferences>ColdFusion>Server Settings. Whether that makes sense to change is dependent of course on how often your server config changes (new DSNs, new CFCs, etc.) Since CFB can't know what's best, it defaults to checking quite often.


                    Hope all that's helpful.


                    I point out these things and more in a talk I've given a couple of times, "Hidden Gems in CF Builder", available in both PDF and recorded form at http://www.carehart.org/presentations/.



                    • 7. Re: Simple HTML Preview
                      robliesland Level 1

                      Thanks, Charlie. I tried that, without having any servers set up, and it still gave me the same error when I tried to preview.


                      So, I set a server up. I set up one of our multiple nodes which sit behind a l-b. We are still running CF8, so it is not fully-functional, but it at least worked. I tried to add that to the project, and it did not even appear as an option in the server drop-down.


                      I think I am just going to wait until we get CF9, which will hopefully be soon.



                      • 8. Re: Simple HTML Preview
                        charlie@carehart.org Adobe Community Professional & MVP

                        It gave the same error? Really? Because in fact I got an unexpected (and different) error.


                        I just created a new CF project, and did not define a server for it, and sadly when I selected "set url prefix", it complained that "the project containing the resource does not have an associated server". That's just odd because it flies in the face of (at least what I thought was) the very purpose of the feature.


                        Hmm. Let's see now if someone from Adobe can step in to clarify things.


                        BTW, I can't see how there's any connection between your next issue and whether you're running CF 8 or 9. Builder doesn't care about that, with regard to this feature. There may be some other explanation for why you didn't see servers in the drop down. This part of CFB is among the more delicate and less well-understood, from my observation.